http-headers

correct HTTP header for json file

I've searched around and found two different ways to define Content-type for JSON file loaded with php. header('Content-type: text/json'); header('Content-type: application/json'); which one should be used ? ...

Blank page in IE6

A site I am working on that is built using PHP is sometimes showing a completely blank page. There are no error messages on the client or on the server. The same page may display sometimes but not others. All pages are working fine in IE7, Firefox 3, Safari and Opera. All pages are XHTML with this meta element: <meta http-equiv="Content...

How to show the visitor a moved web page AND return a 301 redirect HTTP response status code in Django?

When a webpage has moved to a new location, how do I show the moved web page AND return a 301 permanent redirect HTTP response status code in Django? ...

getting a download prompt due to response mixed up from two requests

I have 4 iframes in my page whose src's change as I scroll down my web page. The faster I scroll the src's change more frequently. If I scroll fast enough I get a download prompt in FF. The downloaded file contains garbled text followed by http response headers and then more garbled text. When I capture this on ethereal I see that the ...

Size of uploaded file

Do web browsers send the file size in the http header when uploading a file to the server. And if that the case, then, is it possible to refuse the file just by reading the header and not wait for the whole upload process to finish? ...

'Refresh' HTTP header

I'm automating a web application (the Mantis bug tracker) and I'm getting an interesting response header from it, called Refresh: HTTP/1.x 200 OK ... Refresh: 0;url=my_view_page.php It seems to be acting the same way that meta refresh does, and the meta refresh technique implies that it is an equivalent of a header in HTTP. Problem i...

REST: Correct HTTP Response Code For a POST Which Is Ignored

We have a REST API which clients routinely POST and PUT data to. When they do this, sometimes they POST data which results in no change on our system. The POSTs and PUTs are well-formed, but they data they're sending is identical to the data in our database. When this happens, I've just found out that we're returning a 400 HTTP statu...

What makes IE 6 & 7 report 'Operation Aborted'?

Recently an application I wrote started not working on Internet Explorer. There has been no change to the underlying (ruby on rails) code. In IE 6 or IE 7, I can make one request (HTTP Post) to the app, but when I try to make a 2nd request, I get an "Operation Aborted" message. Everything works fine in firefox. The HTTP Request and Res...

404 Hijacking

Certain malware such as AVG hijack 404 pages in order to display a page in the browser riddled with their own ads. The only work around I've found is to abandon 404 http status codes for custom error pages in my webapp. Is there any other work around? Edit: Anybody know of any other toolbars/programs that also hijack 404 pages without...

How to modify http-headers on static files served by JBoss

I have a web application (.war) that contains some static files (e.g. MS word documents). When I try to download these files, JBoss automatically sets some HTTP-headers in the response. Is there a way to configure JBoss (version 3.2.7) to set these headers to specific values (or omit them)? I'm especially interested in the Cache-Contr...

Proper MIME type for PDF files

When working with PDFs, I've run across the MIME types 'application/pdf' and 'application/x-pdf' among others. Is there a difference between these two types, and if so what is it? Is one preferred over the other? I'm working on a web-app which must deliver huge amounts of PDFs and I want to do it the correct way, if there is one. ...

how to (simply) generate POST http request from java to do the file upload

I would like to upload files from java application/applet using POST http event. I would like to avoid to use any library not included in SE, unless there is no other (feasible) option. So far I come up only with very simple solution. - Create String (Buffer) and fill it with compatible header (http://www.ietf.org/rfc/rfc1867.txt) - O...

HTTP Caching, Browsers weirdeness and everything else!

Yesterday I've tried to get serious about rightly caching some PHP generated pages (think "Articles with comments"). Big fail. Long story short: I set the ETag header, set the Last-Modified one and check server side every Article browser request with them to see if I can send back a 304. The problem is simple: the browser (tried with F...

How to determine if a page is being redirected

Hi, I need to check whether a page is being redirected or not without actually downloading the content. I just need the final URL. What's the best way of doing this is Python? Thanks! ...

HTTP header "Via:1.1 nc1 (NetCache NetApp/6.0.5P1)" stops IIS6 gzip compression

The request I sent is accept gzip but the response is not compressed, instead, I received some header Via:1.1 nc1 (NetCache NetApp/6.0.5P1) I guess this is to do with my ISP since it works perfectly on my home computer. Any idea how to get the response compressed? Request header GET /test.aspx HTTP/1.1 Host this.is.example.com ...

HTTP HEAD Request in Javascript/Ajax?

Is it possible to do a HTTP Head request solely using an XMLHTTPRequest in JavaScript? My motivation is to conserve bandwidth. If not, is it possible to fake it? ...

Will Request.UserHostName always give me the user's computer name?

Basically I want to make sure I will always get the computer's name rather than any proxy or other hardware imbetween. ...

Web forwarding proxy in C# or PHP available?

I have some shared server web hosting in the States (I'm from the UK), which allows me to publish PHP and .NET applications. I cannot install my own software onto the remote server, but I'd like to set up a web forwarding proxy for accessing sites that serve different content depending on what country you're from. My C# and ASP.NET skil...

XHTML - What are the problems associated with serving pages with Content: application/xhtml+xml

Hi Stackers I started some of my new web pages (xhtml 1.1) to do a regex of the request header 'Accept' and sending it the right XHTML headers if accepted XML (Firefox does, So does safari). IE (or any other browser that doesn't accept it) will just get the plain text/html headers. Will Google bot (or any other search bot) have any p...

How to send a header using a HTTP request through a curl call?

I wish to send a header to my apache server on a linux box. Using a curl call how can I achieve this? ...