http-headers

Parsing POST from Gnip.com via PHP

Hello! I've set up a filter at Gnip.com. In the field "POST URL" I've typed in my script URL. The URL is correct since Gnip.com really calls it. But when the script is called, I don't get any data. I've tried to parse $_GET and $_POST but both are empty arrays. getallheaders() gives me some data but no XML. How do I get the XML sent by ...

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(). ...

Uses of content-disposition in an HTTP response header

I have found the following asp.net code to be very useful when serving files from a database: Response.AppendHeader("content-disposition", "attachment; filename=" + fileName); This lets the user save the file to their computer and then decide how to use it, instead of the browser trying to use the file. What other things can be done ...

What are the security considerations of using the content-dispositon HTTP header?

In response to this, what are the security considerations when using the content-disposition HTTP header? ...

HTTP Header

I am using a virtual host, so I have a shared IP address. I would like to access my test site by sending the hostname http header to the IP address, so the server can resolve the name and send back my site page. I am using an unregistered domain name on the server so I can't just type the url into the browser. Does anyone know the easies...

How do you get the 'referer' header in PHP?

I want the the url of the page from which a request has been made. How can I do that in PHP? ...

What Encoding Do I Perform On Media Before Sending It In A HTTP Response Body

Hi there, I am currently developing a HTTP server. When a client requests a PNG, my response headers are properly formatted and respond with Content-Type : image/png What steps and encoding processes do I have to perform on my .png file to send it as a byte[] in the http response body? Thanks! ...

SoapAction Issue under Java 1.3

This problem has been bothering me for days. Hopefully someone has come across this before and has developed a workaround. So I've developed a middleware Java app which during its execution invokes a SOAP action. Now, the behavior of this bit of code under the 1.6 JDK is working well: // inside a try-catch block SOAPCon...

What's the difference between Cache-Control: max-age=0 and no-cache ?

max-age=0 implies that the content is considered stale (and must be re-fetched) immediately, which is in effect the same thing as no-cache. Google has failed to solve this mystery for me :( ...

How to select content type from HTTP Accept header in PHP

I'm trying to build a standard compliant website framework which serves XHTML 1.1 as application/xhtml+xml or HTML 4.01 as text/html depending on the browser support. Currently it just looks for "application/xhtml+xml" anywhere in the accept header, and uses that if it exists, but that's not flexible - text/html might have a higher score...

How do you send raw headers in ruby

I have a page which uses the UTF-8 character set, however the characters are mangled on the page, I think this is just a matter of setting a header "Content-Type: text/html; charset=utf-8" ... I know how to do this in PHP, simply place the following at the top of the page. <?php header("Content-Type: text/html; charset=utf-8"); ?> Is ...

customizing default values for HTTP request headers in Internet Explorer

Hi, In Firefox, we can customize the default values for HTTP headers, let's say for changing the "Accept-Encoding" header in an HTTP request (type "about:config" in browser and serach for preference "network.http.accept-encoding", you can double click this value and can customize it) Can this be possible in Internet Explorer? Recently...

How do I force or add the content length for ajax type POST requests in Firefox?

I'm trying to POST a http request using ajax, but getting a response from the apache server using modsec_audit that: "POST request must have a Content-Length header." I do not want to disable this in modsec_audit. This occurs only in firefox, and not IE. Further, I switched to using a POST rather than a GET to keep IE from caching my re...

Destroying $_SERVER session?

Okay so I'm not using any session variables, rather my code looks like this: if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="Enter your Twitter username and password:"'); header('HTTP/1.0 401 Unauthorized'); echo 'Please enter your Twitter username and password to view your followers.'; ex...

Is there any way to modify the HTTP headers for IE6?

I need to be able to modify the HTTP headers for Internet Explorer for testing purposes. Basically, I want to achieve the exact same thing that the Modify Headers plugin for Firefox does. ...

Is there a practical HTTP Header length limit?

I have a web application that adds contextual information to XmlHttpRequest objects using the setRequestHeader API. I am using a custom header name (e.g. X-Foo) and a JSON structured value. It isn't part of the URL QueryString or POST body because it is meta information about the request. Is there a practical size limit to the header ...

HTTP headers "q" factor in firefox?

Hi, Does anyone know what the "q" factor HTTP headers emitted by Firefox 3 mean? It only appears in the Accept and Accept-Charset headers. For example: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,**/**;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 I've tried trawling the web but I haven't quite found the an...

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 Opera) private void GenerateXmlAttachment(string xmlInStringFormat, string fileName) { ...

What caching headers prevent browsers from requesting last modified dates from the server?

Since I version all my css/js/images, they never "change". It might go from sprite.4.png to sprite.5.png, but sprite.4.png will never change. Anyway, it seems pointless for the browsers to be checking for modified versions and receiving 304 responses, so what do I need to put in .htaccess to prevent these last modified look ups? Right ...

ASP.NET MVC: OutputCache and http headers - Cache-Control

Hi guys I have just started using OutputCache on some of my controller actions and I am not quite getting the response I would expect. Basically I have set Location = OutputCacheLocation.Any and the http header is as follows: Server ASP.NET Development Server/9.0.0.0 Date Wed, 15 Jul 2009 02:14:21 GMT X-As...