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
2 answers

How to serve a .dmg file via PHP/readfile?

I'm having no luck serving a .dmg from my online store. I stripped down the code to just the following to debug, but no matter what I get a zero-byte file served: header('Content-Type: application/x-apple-diskimage'); // also tried…
CaymanCarver
  • 389
  • 3
  • 14
6
votes
3 answers

Duplicated "set-cookie: ci-session" fields in header by codeigniter

For each time $this->session->set_userdata() or $this->session->set_flashdata() is used in my controller, another identical "Set-Cookie: ci_session=..." is added to the http header the server sends. Multiple Set-Cookie fields, with the same cookie…
mathulus
  • 75
  • 1
  • 5
6
votes
4 answers

Syntax of HTTP-status headers

There're many ways to write an HTTP-status header: HTTP/1.1 404 Not Found Status: 404 Status: 404 Not Found but which is the semantically-correct and spec-compliant way? Edit: By status headers I mean this, using a function such as PHP's header().
moo
  • 7,619
  • 9
  • 42
  • 40
5
votes
1 answer

How to cache a HTML page with must-revalidate?

When caching a HTML page with must-revalidate, this means that browser must check for any update defined by Last-Modified or Etag. However, the problem is that before max-age, browser will not make any connection with the website to read HTTP…
Googlebot
  • 15,159
  • 44
  • 133
  • 229
5
votes
3 answers

Should the website main page be cached?

To my knwoledge, caching should be ONLY enabled for static contents of website, and we use no-cache for dynamic pages. The website main page is the most dynamic page as contents are regularly updated. Strangely, I found that major websites set a…
Googlebot
  • 15,159
  • 44
  • 133
  • 229
5
votes
2 answers

How to send KeepAlive header correctly in c#?

I need to send a request like this using HttpWebRequest: POST https://sap.site.com.mx/sap/bw/BEx?SAP-LANGUAGE=ES&PAGENO=1&CMD=PROCESS_VARIABLES&REQUEST_NO=0&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VARID= HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT…
auraham
  • 1,679
  • 2
  • 20
  • 27
5
votes
1 answer

Header Location + Content Disposition

So I have a downloads page where you click a link, it opens /downloads/download/randomhash randomhash is found in the db, i increment a download counter, and then redirect to the actual file e.g. /uploads/2012/file.png. Everything works except for…
Benno
  • 3,008
  • 3
  • 26
  • 41
5
votes
2 answers

Django Test Client: How to remove http headers

I am trying to write a unit test for a piece of code that checks if a header is missing. How can I omit the http_referer header (or any header for that matter) from Django's test client? def testCase(self): response =…
Sbrom
  • 71
  • 1
  • 5
5
votes
1 answer

Response.WriteFile & Response.Redirect

I'm publishing a page URL eg mysite.com/disclaimer/someinfo this page shows an agreement, and if the user clicks the agree button then a PDF file is streamed as an attachment. The purpose of this is the user can then share this URL but anyone else…
John C Scott
  • 146
  • 11
5
votes
1 answer
5
votes
1 answer

Still necessary to use 'Status: 404 Not Found' for FCGI?

Usually, when sending a http status header from PHP, one would send the HTTP header like this: header("HTTP/1.0 404 Not Found"); However, the PHP manual says that for FCGI hosts, one would need to send a "Status" header that is then converted into…
F21
  • 32,163
  • 26
  • 99
  • 170
5
votes
1 answer

Validate incoming request based on Request Header in apache http server

We have a web application (JQuery and Spring) running on weblogic app server. There is a apache http server in front of the app server. All incoming requests will come through the web server and reaches the app server. Now we have a requirement that…
5
votes
2 answers

How to send an HTTP header in java

Is it possible to send a Http header via a URL connection in java? I had this working using sockets, but ran into issues with a firewall which don't seem to be a problem with URLConnection. From looking at the API I get the impression that the…
Simonw
  • 852
  • 4
  • 12
  • 29
5
votes
2 answers

changing a specific header in yaws respond

I would like to change the http-header "Server: " value dynamically (while building the respond) in yaws. I tried:- [{status, 200}, {allheaders, [{header, ["Server: ","ASP.NET Development Server/10.0.0.0"] }] }, …
IMHeadHunter
  • 272
  • 3
  • 11
5
votes
1 answer

How to download exported csv file in Wordpress

I work on the plugin that creates menu in wp-admin/ side and shows the table with some data. I need to generate CSV ( it's going correct ) and give user to donwload it automatically. I know, that I have to add the headers like these…
Mak
  • 19,913
  • 5
  • 26
  • 32