1

When I look at the list of standard HTTP headers for requests and responses on Wikipedia (http://en.wikipedia.org/wiki/HTTP_header), most headers are only reasonable when they occur once in a request or a response.

Most. Not all. Especially the Cookie in a request and Set-Cookie in a response could be present multiple times when we are dealing with multiple cookies to be set by the server or transmitted back by the client.

When the server wants to set multiple cookies, there is one Set-Cookie header for each one. The client then presents these cookies with one Cookie header for each.

Apart of cookies: are there other HTTP headers that could be present multiple times (in a valid HTTP request)?

1
  • It would be really helpful if you could you need to know this. Are you writing an HTTP parser and do you have an actual problem? Do you have an existing library that explodes upon encountering a certain HTTP request or response? Do you "just want to know"? Did you try reading the relevant RFC's? Commented Oct 7, 2013 at 10:47

1 Answer 1

3

https://www.rfc-editor.org/rfc/rfc2616#section-4.2

Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)].

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.