gethttp.info

A minimalist HTTP headers inspector. Here are your request headers as received by the server.

If need to access this info from the command line, then you can use it from cURL.


Your HTTP Headers

Parameter Value
IP Address54.227.31.145
Remote Hostec2-54-227-31-145.compute-1.amazonaws.com
Request MethodGET
Server ProtocolHTTP/1.1
Hostgethttp.info
Referer
User-AgentCCBot/2.0 (https://commoncrawl.org/faq/)
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encodinggzip
Accept-Language
Connection
Authorization
Port80
Query String
Request URL/

Why Do I Need to See My HTTP Headers?

This is a developer tool. It shows you the most common HTTP headers from your browser request as they were received by the server. Sometimes this is all you need to catch an unexpected user agent - without cracking open Chrome or Firefox inspector. It's also very handy for mobile where your browser requests are so much harder to debug.

You can find a list of the most common HTTP header fields and their definitions on this page.


Using from the Command Line Via cURL

You can use this tool directly from the command line using cURL:-

$ curl http://gethttp.info

This will return the headers in JSON format, which will look something like this:-

{
    "HTTP_HOST": "gethttp.info",
    "HTTP_USER_AGENT": "curl/7.55.1",
    "HTTP_ACCEPT": "*/*",
    "SERVER_PORT": "80",
    "SERVER_PROTOCOL": "HTTP/1.1",
    "REQUEST_METHOD": "GET",
    "QUERY_STRING": "",
    "REQUEST_URI": "/"
}

Note that if you modify the cURL request so the User-Agent is no longer of the form curl/x.xx.x, the response will revert to HTML as the server will think it's a browser request.


Getting a Specific HTTP Header Using cURL

You can get any HTTP header from the command line using cURL:-

$ curl http://gethttp.info/Header-Name

where Header-Name is the HTTP header name such as Referer or User-Agent. Case is ignored but you must separate words with a hyphen. For example, to ask for the Accept header:-

$ curl http://gethttp.info/accept
*/*

Because it was called from cURL, the default */* value was returned. If you want to try a different setting you can send one explicitly in cURL using the -H option.

Individual header values are returned by default in text/plain format. If you need them in JSON, you can specify the application/json as the preferred content type:-

$ curl -H "Accept: application/json" http://gethttp.info/Accept
{
    "Accept": "application/json"
}

Content type negotiation can get quite complex (and meta). For example, this is how to test a more complex content negotiation of the Accept header:-

$ curl -H "Accept: application/json;q=0.9,text/plain" http://gethttp.info/Accept
application/json;q=0.9,text/plain

As you can see, the command returned the content in plain text because there was no quality value associated with the text/plain so it was assigned a default quality of 1.0, which is higher than the 0.9 quality specified for the application/json type.

Forcing JSON Content

Alternatively, because JSON is such a useful format, you can override the Accept header completely by using a .json extension on the URL:-

$ curl -H "Accept: text/plain" http://gethttp.info/Accept.json
{
    "Accept": "text/plain"
}

This is obviously much more convenient than specifying headers for the content.


Getting Your IP Address Using cURL

You can get just your IP address from the command line using cURL:-

$ curl http://gethttp.info/ip

To force the output in JSON format, use the .json extension:-

$ curl http://gethttp.info/ip.json

Getting Your Hostname Using cURL

You can get your hostname from the command line using cURL:-

$ curl http://gethttp.info/host

Again, for JSON format, use the .json extension:-

$ curl http://gethttp.info/host.json