TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Redirects to /api/echo with the chosen redirect status

GETPOSTPUTPATCHDELETEHEADhttps://api.testingapis.com/api/redirect/status/{code}Sign in to see this endpoint's URL

Redirects to /api/echo with the chosen redirect status.

Accepts GET, POST, PUT, PATCH, DELETE and HEAD. Use it to check client behaviour: after a POST, a 303 should be followed with GET (body dropped), while 307 and 308 must repeat the same method and body. /api/echo shows what arrived.

Parameters 1

NameTypeDescription
coderequiredpath · integer (int32)Redirect status: 301, 302, 303, 307 or 308.

Responses

200
OK
301
Moved Permanently.
302
Found.
303
See Other.
307
Temporary Redirect (method and body kept).
308
Permanent Redirect (method and body kept).
400
Unsupported code.

Example

Request
curl -X GET "https://api.testingapis.com/api/redirect/status/302" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response302 Found
Location: /api/echo

{
  "status": 302,
  "statusText": "Found",
  "location": "/api/echo",
  "remaining": null,
  "keepsMethod": false
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.