http-headers

Paging in a Rest Collection

I'm interested in exposing a direct REST interface to collections of JSON documents (think CouchDB or Persevere). The problem I'm running into is how to handle the GET operation on the collection root if the collection is large. As an example pretend I'm exposing StackOverflow's Questions table where each row is exposed as a document (n...

is HTTP partial GET a reliable mechanism?

Is HTTP partial GET a reliable mechanism? If it is, how come it seems like modern browsers still start from the beginning instead of resuming the download? ...

Parsing HTTP User-Agent string

What is the best method to parse a User-Agent string in Python to reliably detect Browser Browser version OS Or perhaps any helper library that does it ...

Using Google's ClientLogin Interface via XMLHttpRequest in Javascript

I am trying to learn the ClientLogin Interface detailed on the Account Authentication APIs on Google code website. I am using Firefox 3.5pre (Shiretoko) and XMLHttpRequest object in Javascript to follow the process. Here's a stripped down version of what I have: <html> <head> <title>Test</title> <script type="text/javascript"> //<![C...

Can I coerce Apache into not including a WWW-Authenticate header for failed HTTP Basic Auth?

I'm using HTTP Basic Authentication with AJAX requests. Firefox 3 is a whiner and always displays a dialog box for failed credentials -- even though I don't want one. This question summarizes some of the browser and JS issues; you'll notice it's unresolved on the client side. Luckily, I have at least some freedom to change the serve...

how to set a header when serving a static file

I want to host an ical file, but when serving it, I need to set the Content-type header to calendar and stuff in php, I would just <?php header ("Content-type: text/calendar") ?> //calendar stuff proceeds Can I do the same using ruby? or can I somehow tell apache to set a different header when serving this file? ...

What should I pass for the WWW-Authenticate header on 401s if I'm only using OpenID?

The HTTP spec states: 10.4.2 401 Unauthorized The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. If the only login scheme I support is OpenID (or CAS, or OAuth tokens, &c.), what should I put in this...

Sending info with a HTTP redirect that the browser should send to the redirected location?

Is this possible.. for example, imagine I respond to a request with a 302 (or 303), and I inform the browser to do a request to a given location.. is there a header that I can send with the HTTP 302, so that the subsequent request from the browser would include that header? I know I could do this with the location header, as in redirect...

PHP - HTTP Post - incorrect headers

Hi I'm currently trying to post an xml file to an external server, but I'm getting a response back that the headers are incorrect. The server I'm posting requires some headers and I'm wondering if they're in the correct format or if there are any other "standard" headers that need to be included? My code is: <?php function httpsPost($...

http post headers

Hi, When I post some headers in a request and view them on on the receiving page, most of them are prefixed with "HTTP_" except for a few like [CONTENT_TYPE] => text/xml [CONTENT_LENGTH] => 8647. When I post my own headers (which are required for an external server) they then get prefixed e.g. My header: BATCH_TYPE shows up as HTTP_...

What does Cache-Control mean when a client uses it?

I thought I understood what the Http Header "Cache-Control: max-age=3600" meant but then I came across it in a client request as this: Cache-Control: max-age=0 I'm not entirely sure what this means from a client's perspective. Any insight would be great. Thanks ...

Duplicate etag question

Will two URLs that both give the same etag have their representations treated as swappable? For example if I have two images A.gif and B.gif and for some reason GET /A.gif and GET /B.gif both result in the same etag header, will A.gif occasionally be replaced by B.gif in the client's browser and vice versa? ...

what does this configuration in apache mean?

Header append Vary User-Agent env=!dont-vary Can anyone give a detailed explanation for this? ...

What does HTTP/1.1 302 mean exactly?

Some article I read once said that it means jumping (from one URI to another), but I detected this "302" even when there was actually no jumping at all! ...

HTTP Post headers, received differently from what's being sent

HI I'm tring to send some headers in my PHP script such as $headers[] = "BATCH_TYPE: XML_SINGLE"; $headers[] = "VENDOR_ID: 56309"; But they are being received as: Batch-Type Vendor-ID ..not as they were intended or required - which is causing me problems. Anyone know why or how to sort? Thanks, <?php function httpsPost($Url, $...

Encryption of HTTPS headers

To what extent, if at all, are HTTPS headers encrypted? ...

How to remove "X-Runtime" header from Nginx/Passenger?

EDIT -- the solution I posted below probably applies to any server (Nginx/Apache/anything else), because this header is set in Rails itself. Anyone know where the "X-Runtime" header can be removed in Nginx & Passenger? I've grepped the source files and haven't found anything yet, but I'd like to get rid of it for security since it's ...

Header function for php, a comprehendable list?

PHP allows you to send RAW HTTP headers, which must be sent before any of the content. For instance(straight from the PHP documentation): <?php // We'll be outputting a PDF header('Content-type: application/pdf'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="downloaded.pdf"'); // The PDF sour...

What content length should I send when I am encoding data with gzip?

I am writing a small web server and would like to send gzipped data. In the http header for the Content-Length field do I set the length of the compressed data or the length of the uncompressed data? ...

How to write a proxy server in Python?

I want to write a program that changes the HTTP headers in my requests that are sent by my web-browser. I believe it can be done with a proxy server. So, I'd like to write a proxy server. I study programming. How can I do this in Python? ...