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 Address | 18.97.9.172 |
Remote Host | 18-97-9-172.crawl.commoncrawl.org |
Request Method | GET |
Server Protocol | HTTP/1.1 |
Host | gethttp.info |
Referer | |
User-Agent | CCBot/2.0 (https://commoncrawl.org/faq/) |
Accept | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
Accept-Encoding | br,gzip |
Accept-Language | en-US,en;q=0.5 |
Connection | close |
Authorization | |
Port | 80 |
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