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

Starts a redirect chain of n hops that uses relative references

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

Starts a redirect chain of n hops that uses relative references.

Location values such as 2 and ../../echo must be resolved against the current URL by the client.

Parameters 1

NameTypeDescription
nrequiredpath · integer (int32)Number of redirects remaining, 1-20.

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/relative/3" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response302 Found
Location: 2

{"status": 302, "statusText": "Found", "location": "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.