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 Address34.204.198.73
Request MethodGET
Server ProtocolHTTP/1.1
User-AgentCCBot/2.0 (
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

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

    "HTTP_HOST": "",
    "HTTP_USER_AGENT": "curl/7.55.1",
    "HTTP_ACCEPT": "*/*",
    "SERVER_PORT": "80",
    "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

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

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"
    "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"

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"
    "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

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

$ curl

Getting Your Hostname Using cURL

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

$ curl

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

$ curl