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

Starts a redirect chain of n hops that ends at /api/echo

GEThttps://api.testingapis.com/api/redirect/{n}Sign in to see this endpoint's URL

Starts a redirect chain of n hops that ends at /api/echo.

Parameters 1

NameTypeDescription
nrequiredpath · integer (int32)Number of redirects remaining, 1-20. Each hop uses a path-absolute Location (/api/redirect/{n-1}).Number of redirects remaining, 1-20. Each hop uses a path-absolute Location (…).

Responses

200
OK
302
Redirect to the next hop.
400
n outside 1-20.

Example

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

{
  "status": 302,
  "statusText": "Found",
  "location": "/api/redirect/2",
  "remaining": 3,
  "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.