# Astro, set response header

> A quick reference for setting a response header in an Astro component with Astro.response.headers.set, shown here sending an HX-Redirect header.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2024-09-14 | Topics: [Astro](https://flaviocopes.com/tags/astro/) | Canonical: https://flaviocopes.com/astro-set-response-header/

Here’s how to set a response header in an [Astro](https://flaviocopes.com/astro-introduction/) component:

```typescript
Astro.response.headers.set('HX-Redirect', '/login')
```
