Redirect.li API

Access the Redirect.li service through the API.

HTTP API

Get HTTP headers

Get HTTP response header information for a URL

GEThttps://api.redirect.li/v1/http/

Query Parameters

These parameters can be supplied as a GET parameter.

urlstring

URL to get information for

200 Success

This JSON object will be returned on a successful query.

requestobject

The URL address that was requested. Some parts may be missing.

protocolstring

The URL protocol

hoststring

The URL host domain

pathnamestring

The URL path

searchstring

The URL parameters

urlobject

The full URL

statusstring | null

HTTP status code, or error

statusMessagestring | null

HTTP status code message

statusDescriptionstring | null

HTTP status description

timeTotalobject

Total number of milliseconds for the whole request

stepsobject[]

Each request returns a step `object`. Multiple steps may be returned if a URL redirects.

requestobject

The URL address that was requested. Some parts may be missing

protocolstring

The URL protocol

hoststring

The URL host domain

pathnamestring

The URL path

searchstring

The URL parameters

urlstring

The full URL

statusstring | null

HTTP status code, or error

statusMessagestring | null

HTTP status code message

statusDescriptionstring | null

HTTP status description

ipstring

IP address for the requested server

httpVersionstring

HTTP protocol version

timeTotalinteger

Total time (milliseconds) for this step

timeStagesobject

Timing details for this step

headersobject[]

All the response headers for this step

namestring

Header name

valuestring

Header value

alternatestring

Alternative representation for value. For example, 3600 seconds = 1 hour

descriptionstring

Header description

problemsobject

List of problems associated with this header

namestring

Identifier for the problem

titlestring

Text description of the problem

typestring

Header type, otherwise `string`

linkstring[]

URLs for more information about this header

itemsstring

Items

detailsstring

Details

problemsobject[]

List of problems

namestring

Identifier for the problem

titlestring

Text description of the problem

Example

HTTP/1.1 200 OK
{
    "url": "https://apple.com",
    "status": 301,
    "statusMessage": "moved permanently",
    "statusDescription": "This and all future requests should be directed to the given URI",
    "httpVersion": "1.1",
    "timeTotal": 569,
    "timeStages": {
        "wait": 0.8,
        "dns": 2.5,
        "tcp": 1.1,
        "firstByte": 1.1,
        "download": 1.1,
        "total": 569
    },
    "intent": "URL is being redirected to https://www.apple.com/",
    "headers": [
        {
            "name": "server",
            "value": "Apache",
            "description": "A name for the server",
            "details": {}
        }
    ]
}

Decode HTTP headers

Get HTTP response header information for some POSTed headers. Note that some of the response contains empty values where it is not relevant.

POSThttps://api.redirect.li/v1/http/

JSON Body

These parameters can be supplied as a JSON encoded body.

headersstring[]

Array of HTTP header values

Query Example

curl --header "Content-Type: application/json" --request POST --data '{"headers":["accept-ch: value"]}' https://api.redirect.li/v1/http/

200 Success

This JSON object will be returned on a successful query.

requestobject

The URL address that was requested. Some parts may be missing.

protocolstring

The URL protocol

hoststring

The URL host domain

pathnamestring

The URL path

searchstring

The URL parameters

urlobject

The full URL

statusstring | null

HTTP status code, or error

statusMessagestring | null

HTTP status code message

statusDescriptionstring | null

HTTP status description

timeTotalobject

Total number of milliseconds for the whole request

stepsobject[]

Each request returns a step `object`. Multiple steps may be returned if a URL redirects.

requestobject

The URL address that was requested. Some parts may be missing

protocolstring

The URL protocol

hoststring

The URL host domain

pathnamestring

The URL path

searchstring

The URL parameters

urlstring

The full URL

statusstring | null

HTTP status code, or error

statusMessagestring | null

HTTP status code message

statusDescriptionstring | null

HTTP status description

ipstring

IP address for the requested server

httpVersionstring

HTTP protocol version

timeTotalinteger

Total time (milliseconds) for this step

timeStagesobject

Timing details for this step

headersobject[]

All the response headers for this step

namestring

Header name

valuestring

Header value

alternatestring

Alternative representation for value. For example, 3600 seconds = 1 hour

descriptionstring

Header description

problemsobject

List of problems associated with this header

namestring

Identifier for the problem

titlestring

Text description of the problem

typestring

Header type, otherwise `string`

linkstring[]

URLs for more information about this header

itemsstring

Items

detailsstring

Details

problemsobject[]

List of problems

namestring

Identifier for the problem

titlestring

Text description of the problem

Example

HTTP/1.1 200 OK
{
    "url": "https://apple.com",
    "status": 301,
    "statusMessage": "moved permanently",
    "statusDescription": "This and all future requests should be directed to the given URI",
    "httpVersion": "1.1",
    "timeTotal": 569,
    "timeStages": {
        "wait": 0.8,
        "dns": 2.5,
        "tcp": 1.1,
        "firstByte": 1.1,
        "download": 1.1,
        "total": 569
    },
    "intent": "URL is being redirected to https://www.apple.com/",
    "headers": [
        {
            "name": "server",
            "value": "Apache",
            "description": "A name for the server",
            "details": {}
        }
    ]
}