3

What is the difference between passing values in a HTTP request as parameters or Headers as in this example:

HTTP Request:

GET /<api version>/<account> HTTP/1.1
Host: storage.swiftdrive.com   
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb

HTTP Response:

HTTP/1.1 200 Ok
Date: Thu, 07 Jun 2010 18:57:07 GMT  
Server: Apache  
Content-Type: text/plain; charset=UTF-8  
Content-Length: 32

Are Host and X-Auth-Token on the request, as well as Date, Server, Content-Type, and Content-Length on the response, parameters or HTTP headers if I use them in a curl request?

I'm working on a tool in which I must specify if these values are parameters or Request Headers, and I don't how to do that.

Thanks

Community
  • 1
  • 1
Dady
  • 1,197
  • 2
  • 10
  • 11
  • 3
    If you mean "query parameters" (aka GET parameters), they are part of the URL and thus part of the first line of the request. Request headers are separate lines in the request. Everything you mentioned are headers. – leemes Aug 13 '13 at 11:59
  • I think yes GET parameters, cause when i make the request i do : curl -H 'X-Auth-Token : ************' storage.swiftdrive.com (i use them in the URL), can you give me please an example of GET parameters and Request headers ? to have an idea of the difference, i've a problem of notions in these two concepts! – Dady Aug 13 '13 at 12:07
  • GET parameters are for example in this URL `http://www.example.com/?foo=bar&baz=boom` (Here, two parameters have been set: `foo = bar` and `baz = boom`, and they start after a question mark and are separated with the ampersand). The rest of the URL is the protocol aka scheme (`http`), the domain (`www.example.com`) and the path (`/`). Sometimes you also see something after a hash sign `#`, this is called the "fragment" but it's not sent through HTTP, so you never see them in HTTP requests. See also [here](https://en.wikipedia.org/wiki/URI_scheme#Generic_syntax). – leemes Aug 13 '13 at 12:08

0 Answers0