http-headers

Save remote file that pushes headers to force download

Hello all, I can download remote files using PHP but how do you download from a link that pushes headers out? I mean, you can click on some links and it will force a download and present you with dialog box to save the file. How can I download and save this sort of thing using PHP? Any examples or links to tutorials would be great sinc...

Can I pass custom data in the HTTP header?

I have a whole bunch of web services each with several web methods. The consumers of these services are varied and many. I want to augment each of these web methods with an extra optional parameter (Int64 or Int32) but adding new methods with this extra (optional parameter) is a lot of work and getting the clients to use the new methods ...

ASP.NET Post Application_Error Event

I'm trying to find an event that will fire immediately after all Application_Error event handlers so that I can modify the response sent (messing with the status code and 'location' headers and creating a new body specifically) using a custom HttpModule. I've tried hooking into Application_EndRequest (as I've read that this is the only ...

What is the current state of the Cookie2 specification?

Do you have some information regarding browsers that implement/plan to implement this part of the HTTP 1.1 specification? Additionally, what frameworks have already implemented this feature. I've done my Google research but I'd like to know if there's something else. Also, do/would you use it? Do you find it better than the Cookie/Set-C...

WSGI byte ranges serving

I'm looking into supporting HTTP/1.1 Byte serving in WSGI server/application for: resuming partial downloads multi-part downloads better streaming WSGI PEP 333 mentions that WSGI server may implement handling of byte serving (from RFC 2616 section 14.35.2 defines Accept-Range/Range/Content-Range response/request/response headers) and...

Adding Custom HTTP Headers using Javascript

Hi, I have the following requirement. On my html page, While clicking the link of an Image ("img") or anchor("a") tags , I would like to add my custom headers for the GET request. These links are typically for downloading dynamic content. These headers could be SAML headers or custom application specific headers. Is it possible to add ...

How to let the user to download an xml file

What i want to do is that the user selects some fields on a grid and according to these datas i create an xml file on the web server and then i want user to download it like downloading a any file. But the problem is, i cant use this code: Response.ContentType = "APPLICATION/OCTET-STREAM"; // initialize the http content-disposi...

VS Builtin web server sends images as octet-stream

I am debugging an ASP.NET website which has a lot of javascripts and images using Visual Studio 2008 development web server. One of the many scripts try to create an <img> tag on the fly and supply it with a proper src attribute. However, none of the images are loaded and instead alt text are displayed in Firefox, IE and Opera. Digging...

Ruby: How to make an HTTP GET with modified headers

What is the best manner to make an HTTP GET request in Ruby with modified headers? I am attempting to get a range of bytes from the end of a log file and have been toying with the following code, but the server is throwing back a response noting that "it is a request that the server could not understand" (the server is Apache) require ...

Django: How to redirect to an external URL?

[Django 1.0.2] I have a view set up like this: (r'^redirect/(?P<object_id>\d+)/(?P<url>.*)/$', 'django.views.generic.simple.redirect_to', {'content_type': SiteType}, 'clickout'), When I get the following URL, two different things happen on local development server and on remote mod_wsgi server: # GET "/redirect/2/http://www....

How to serve .flv files using PHP?

Hi, I'm building a streaming video site. The idea is that the customers should pay for a membership, login to the system, and be able to view the videos. I'm going with FlowPlayer for showing the actual videos. The problem now is, the videos need to be stored somewhere publically and the url to the .flv files needs to be passed to flo...

How can I clear HTTP headers for AJAX GET calls?

I have developed a solution that relies on an AJAX call to retrieve information and update the client page every 10 seconds. This is working fine, but I am concerned at the scalability of the code, given the number and length of headers being passed from client to server and back again. I have removed a number of redundant headers on the...

How can I set a cookie and then redirect in PHP?

After doing a bit of processing, I want to set a cookie value to user input and then redirect them to a new page. However, the cookie is not getting set. If I comment out the redirect, then the cookie is set successfully. I assume this is a header issue of some sort. What is the best workaround for this situation? if($form_submitted...

HTTP request with custom headers fields using Windows Scripts

Is it possible to perform a HTTP Request with specific header fields (like 'referer', 'cookies' or 'User-Agent') using Windows Script Host or any other Windows scripting technology?? Thanks. ...

What are the differences between HTTP 1.0 and 1.1?

The latest StackOverflow podcast has piqued my interest in the differences between HTTP 1.0 and HTTP 1.1. Can anyone provide a simple list of the major differences between the HTTP 1.0 and HTTP 1.1 specifications? ...

Tool For Constructing HTTP Requests

I'm looking for the best tool that allows me to construct my own http requests. Like the firefox addon poster. Any suggestions. I'm looking at doing some security testing on webservices. Thanks ...

How to add custom HTTP Headers to IIS from the command line

We have an ASP.NET application and I need to add a custom HTTP header to IIS for all the developers on the team, so I want to add a command in the NANT script that will add the HTTP Header when the build script is run. Is it even possible to do this from the command line. I've been looking up the documentation on cscript adsutil.vbs ...

Faking browser request in ASP.net C#

I'm using the code below to pull one of our 3rd party developed pages in so I can parse it as XML for my random bits of work. Irritatingly we stil have a browser detection level set on the server that only allows certain browsers on to the site; so the question is how would I fake it so that the server thinks its a browser request? ...

[i.][m.] HTTP Addresses

I noticed that on the web some sites have subdomains dedicated to images or information on sub-domains such as i.domain.com. I was wondering what is the advantage of this? Is there a name for this type of "Method"? Where can I get more information on this? Thanks. ...

How do you POST to a page using the PHP header() function?

I found the following code on here that I think does what I want, but it doesn't work: $host = "www.example.com"; $path = "/path/to/script.php"; $data = "data1=value1&data2=value2"; $data = urlencode($data); header("POST $path HTTP/1.1\r\n"); header("Host: $host\r\n"); header("Content-type: application/x-www-form-urlencoded\r\n"); head...