Questions tagged [http-headers]

In the Hypertext Transfer Protocol (HTTP), HTTP header fields contain the operating parameters of an HTTP request or response. With the request or response line (first line of message), they form the message header.

The header fields define various characteristics of the data transfer that is requested, or the data that is provided in the message body.

Header fields start with the field name, terminated with a colon character, followed by the field value. Field names and values may be any application-specific strings, but a core set of fields is standardized by the Internet Engineering Task Force (IETF) in RFC 2616 and other updates and extension documents (e.g. RFC 4229), and are commonly understood by all compliant protocol implementations.

Many parameters may be followed by a quality or 'q' value, giving a weight to use in content negotiation. The HTTP message header is separated from the message body by a blank line.

List of HTTP Header fields

11828 questions
6
votes
1 answer

Why doesn't curl send my headers in PHP?

The following code: $ch = curl_init('http://localhost/testweb/search.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_HTTPHEADER,…
HMR
  • 37,593
  • 24
  • 91
  • 160
6
votes
1 answer

Is it possible to modify or add custom http headers on a 301, 302, 303 or 307 redirect?

Does the HTTP protocol allow a 302 request header to be modified so some parameters can be set and passed to the url receiving the request?
lpdahito
  • 556
  • 2
  • 10
  • 16
6
votes
3 answers

What network error could be responsible for Status (failed) and type Pending in Chrome?

From time to time a site I'm maintaining get failed GET requests on some resources. The status is returned as (failed) and the type as Pending. The headers containg nothing more than the request itself, no response whatsoever. The server is running…
oxy
  • 195
  • 4
  • 13
6
votes
2 answers

Is it possible to detect if an image has been loaded via img src="... vs address bar / "as the document"?

Is it possible to detect if an image has been loaded via: Versus in the address bar or linked to directly via: Image Thanks.
anonymous-one
  • 14,454
  • 18
  • 60
  • 84
6
votes
2 answers

Read Browser/Client time from Http Servlet request header

Is it possible to read the Browser(Client machine) time when a request is made to the servlet?
Madhu
  • 5,686
  • 9
  • 37
  • 53
6
votes
2 answers

How can I force a browser to NOT download a file with content-disposition:attachment header

For example: And blah.csv has this header: Content-Disposition: attachment; filename=blah.csv; Is it possible to force blah.csv to render in the iframe instead of downloading?
Matt York
  • 15,981
  • 7
  • 47
  • 51
6
votes
2 answers

How can I set the Cache-Control header for every response in Catalyst?

It seems that by default Catalyst does not output Cache-Control:, etc. headers. I know I can output them in a given controller method like this: $c->response->headers->last_modified(time); $c->response->headers->expires(time +…
derobert
  • 49,731
  • 15
  • 94
  • 124
6
votes
2 answers

scala play 2.0 get request header

I am converting some of my java code to scala and I would like to be able to get a specific header and return it as a string. In java I have: return request().getHeader("myHeader") I have been unable to achieve the same thing in scala. Any help…
user1253952
  • 1,577
  • 8
  • 22
  • 34
6
votes
1 answer

'Most conservative' conversion to GMT?

Section 19.3 "Tolerant Applications" of the HTTP 1.1 RFC (2616) says on the subject of parsing dates from HTTP client applications: If an HTTP header incorrectly carries a date value with a time zone other than GMT, it MUST be converted into GMT…
Ian Goldby
  • 5,609
  • 1
  • 45
  • 81
6
votes
6 answers

Browser doesn't distinguish a partial HTML got via AJAX and a full page

I've got a page that can be accessed at URL /products. When I visit it in a browser it responds with a full page within a layout. Here is a simplified example of request headers and response body: Accept:…
Simon Perepelitsa
  • 20,350
  • 8
  • 55
  • 74
6
votes
3 answers

Why Does FireFox Not Include the .xml Extension when Downloading a File?

OK. I'm sure it does download XML files with the .xml extension, but I'm wondering what is missing in the code here to cause the .xml extenstion to be missing from the downloaded file. Note: This works in IE 6+ (didn't try WebKit based browsers or…
nickytonline
  • 6,855
  • 6
  • 42
  • 76
6
votes
1 answer

Something is forcing responses to have cache-control: private in IIS7

I have this in my web.config:
Glenn Slaven
  • 33,720
  • 26
  • 113
  • 165
6
votes
3 answers

If a HTTP/1.0 client requests Connection: keep-alive, will it understand chunked encoding?

If my HTTP server gets an HTTP/1.0 request with the "Connection: keep-alive" header, is it a fair bet that the client will understand "Transfer-Encoding: chunked"? Essentially, I'm trying to decide whether to honour the "Connection: keep-alive"…
6
votes
2 answers

Adding headers to Spring controllers

I know this question is very similar to this one, but I feel its different and specific enough to warrant its own question here. I've just inherited a Java web app project from a sole developer who left no documentation behind. Its a Spring MVC app…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
6
votes
1 answer

ETag changes when Rack::Deflater is enabled

have stumbled upon something weird when enabling Rack::Deflater to gzip my response body. Perhaps i'm missing something but with this enabled the response is compressed however the ETag for the resource changes on every single request. This is…
Nick Dancer
  • 335
  • 2
  • 9