Edit this page

up.protocol X-Up-Method
HTTP header

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.

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.

Also for technical reason 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

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