http-headers

Clear IE cache when using AJAX without a cache busting querystring, but using http response header

天大地大妈咪最大 提交于 2019-12-11 03:29:47
问题 I'm having the classic IE-caches-everything-in-Ajax issue. I have a bit of data that refreshes every minute. Having researched the forums the solutions boil down to these options (http://stackoverflow.com/questions/5997857/grails-best-way-to-send-cache-headers-with-every-ajax-call): add a cache-busting token to the query string (like ?time=[timestamp]) send a HTTP response header that specifically forbids IE to cache the request use an ajax POST instead of a GET Unfortunately the obvious

Avoid HTTP 302 response code when setting the Location header in PHP after POST

烂漫一生 提交于 2019-12-11 03:23:48
问题 I need to put a 201 Created Response code and a Location header for a POST request, but for some reason I am still getting a 302 response. This is what I have: header('HTTP/1.1 201'); header("Location: ..."); // The new resource URL header('Content-type: application/json; charset=utf-8'); echo $response; exit; I have tried removing the content type, the echo and the exit without any luck, still getting the 302. I read that I need to specify both headers, but that's what I am doing and no luck

Content-Length header ignored by IIS 6?

孤街醉人 提交于 2019-12-11 03:17:02
问题 I'm working on a web app that includes the ability to save uploaded files. Files are stored in a SQL database in an "image" column, and served via a GetFile.aspx page using Response.BinaryWrite(). Until yesterday I was having problems with downloading Office 2007/2010 files. The file would download without trouble, but when Word (or Excel, or whatever Office program) opened it, it would complain about a corrupt file. But it would still open without any immediately apparent problems or missing

How to send an HTTP post with a custom header using REBOL

情到浓时终转凉″ 提交于 2019-12-11 02:44:36
问题 I've been trying to access a site with REBOL using the site's API, but I'm having problems. The API call expects a custom header and a request in XML format. I've been trying with read/custom, but I'm unsure how to include the header, or what format it should take. The default header in system/options/cgi is an object, so I assume it should be an object, but where would you put it? (Adding to system/options/cgi hasn't worked.) I'm guessing the code below is something like what I need... http

jquery - get http headers

。_饼干妹妹 提交于 2019-12-11 02:35:55
问题 How do you get the http headers passed on a page? Is this achievable via javascript/jquery? I'm looking into something like this: http://www.mulliner.org/pc.cgi 回答1: There is no api to get the headers for the current page. The best way to approach this is to make an ajax call to the current page and read them as described in this question. Accessing the web page's HTTP Headers in JavaScript 来源: https://stackoverflow.com/questions/19440768/jquery-get-http-headers

Remove HTTP Response headers in Java

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 02:22:30
问题 Is there a way to remove HTTP response headers like Server and X-Powered-By? My application is using a Weblogic server. I'm programming in Java using the Spring MVC framework and Hibernate, and using JSP for views. 回答1: Depends on where the headers are added. If inside your app, you can use a Spring MVC Interceptor to remove them after your controller calls. If outside your app, you might be able to try a Java EE filter configured in web.xml (the example is security, but the approach will

AWS - Cloudfront - How To Use Origin Custom Headers

余生颓废 提交于 2019-12-11 02:13:24
问题 I'm fairly new to AWS and I'm going through some different training courses right now and one of the interesting things I've stumbled upon is the ability to add Custom Headers in Cloudfront. That said, I can't seem to figure out (or locate simple to understand documentation) as to how to use/leverage the power that this feature offers. Can someone please let me know how: How to access the headers that I set? For example I used terminal to run some basic cURL commands to view the headers to my

Rebol - HTTP response headers

浪子不回头ぞ 提交于 2019-12-11 02:06:21
问题 Where does Rebol (R2) save the HTTP response headers after a call to the read function (which just seems to return the page content)? 回答1: Not sure there is an easy way to get the headers after a straight read. You can get them if you open a port : hp: open http://www.rebol.com probe hp/locals/headers make object! [ Date: "Sat, 07 May 2011 07:08:35 GMT" Server: "Apache" Last-Modified: "Tue, 22/Feb/2011/06:52:26/+GMT" Accept-Ranges: "bytes" Content-Encoding: none Content-Type: "text/html"

How do I fake an specific browser client when using Java's Net library?

蹲街弑〆低调 提交于 2019-12-11 01:46:50
问题 A small program of mine just broke because, it seems, the site I was programmatically browsing now assumes a Java request comes from a mobile phone, and the link I was looking for is not on their mobile page. So I want to fake an Internet Explorer access. How do I do that with java.net? 回答1: IIRC, set "http.agent" system property through System , -D on the command line, in your JNLP file or elsewhere. 回答2: Assuming you're using java.net.URLConnection, then call setRequestProperty(String

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

↘锁芯ラ 提交于 2019-12-11 01:46:42
问题 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 server -- I can modify my .htaccess file. Basically, whenever Firefox sees the WWW-Authenticate header, it tries to authenticate again. Can I suppress that header only