---
name: "X-Up-Method"
area: "API"
kind: "HTTP header"
parent: "up.protocol module"
url: "https://unpoly.com/api/X-Up-Method"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.protocol module](https://unpoly.com/api/up.protocol.md)</nav>

# X-Up-Method

The server may set this optional response header to change the HTTP method after a fragment update.

Without this header Unpoly will use the [requested method](https://unpoly.com/api/up.Request.prototype.method.md).

## Signaling the HTTP method after a redirect {#signaling-the-http-method-after-a-redirect}

Without an `X-Up-Method` header, Unpoly will assume a `GET` method after a redirect.

This assumption is correct for redirects with status codes 301, 302 and 303, and incorrect for the [less common codes 307 and 308](https://makandracards.com/makandra/501468-modern-http-status-codes-for-redirecting).

Also for technical reasons Unpoly cannot detect redirects to the same URL, but using a different method. For example, when a request to `POST /users` redirects to `GET /users`.

You can address both edge cases by including an `X-Up-Method` header in your responses.

## Example {#example}

```http
X-Up-Location: /users
X-Up-Method: GET
```

