http-headers

Get value from RestSharp response headers

本秂侑毒 提交于 2019-12-07 00:18:19
问题 I'm hoping someone can help with an issue I'm having with RestSharp. It's all working; I'm getting my reply using the following code: var client = new RestClient("http://mybaseuri.com"); var request = new RestRequest("service/{id}", Method.GET); request.AddUrlSegment("id", id); // execute the request IRestResponse response = client.Execute(request); I'd like to get a value from the response headers along the lines of: string userId = response.Headers["userId"] I can't find any examples online

Why does Google Chrome NOT use cached pages when I define the HTTP “Expires” header

落花浮王杯 提交于 2019-12-06 23:11:25
问题 I am sending validly formatted HTTP response "Expired" headers (e.g. "Wed, 04 May 2011 09:29:09 GMT") with a page served through https://[host]:{port}/ (with [host] being localhost) from a J2EE application, using response.setDateHeader("Expires", {milliseconds a few seconds in the future} ) . On my pages I have a link to the same page. When I click this link from within Firefox (4) or IE (8), the page is reloaded from cache until the Expired time is reached. Once the Expired time is passed,

What to do with extra HTTP header from proxy?

与世无争的帅哥 提交于 2019-12-06 22:04:03
问题 Our environment requires the use of an outbound proxy for offsite services. Normally this isn't a problem. In this case with Twilio, the extra header returned breaks the client. Outgoing headers: POST /2010-04-01/Accounts/FOO/SMS/Messages.json HTTP/1.1 Authorization: Basic FOO== User-Agent: twilio-php/3.10.0 Host: api.twilio.com Accept: */* Accept-Charset: utf-8 Content-Type: application/x-www-form-urlencoded Content-Length: 108 Response Headers: HTTP/1.0 200 Connection established HTTP/1.1

How can I keep an IE page request alive more than 1 minute?

≡放荡痞女 提交于 2019-12-06 19:25:29
If you are connected to the Internet directly (and not through a proxy) and requests for a page (get/post) in Internet Explorer 7, the default time-out is 1 minute. If the response from the web server takes more than a minute then you end up getting a "Network error" from IE. How can I increase this timeout in IE? Microsoft has documented How to change the default keep-alive time-out value in Internet Explorer , but this does not work in my PC (Windows XP SP2, IE 7.0). Does anyone out there have a clue on how to achieve this? Thanks KB813827 is talking about HTTP 1.1 keepalives, which are to

X-Frame-Options ALLOW-FROM a specific site allows from all

百般思念 提交于 2019-12-06 18:59:58
问题 I'm using a rails application to serve a page from abc.com. In it, I set the response headers in my application controller (for every request through before_filter) so that it can be accessed through an iframe only from a specific site (xyz.com), through the following code: def set_x_frame_options response.headers["X-Frame-Options"] = "ALLOW-FROM http://www.xyz.com" end The problem is, not only am I able to access the page from abc.com on xyz but also on any other website. I want to limit the

How does one parse HTTP headers with libcurl?

有些话、适合烂在心里 提交于 2019-12-06 18:50:14
问题 I've been looking around and am quite surprised that there seems to be no means by which one can parse headers generically in libcurl (which seems to be the canonical C library for http these days). The closest thing I've found was a mailing list post where someone suggested someone else search through the mailing list archives. The only facility that is provided by libcurl via setopt is CURLOPT_HEADERFUNCTION which will feed the header responses a single line at a time. This seems entirely

What is the correct Content-Length to set for a GET request?

人盡茶涼 提交于 2019-12-06 17:36:00
问题 When I make a POST request using the following code: string body = "Hello World"; byte[] bytes = Encoding.ASCII.GetBytes(body); WebRequest request = WebRequest.Create("http://internalurl"); request.Method = "POST"; request.ContentLength = bytes.Length; I set the content length to the number of bytes POST ed. What is the correct ContentLength for a GET request? 回答1: Since you normally doesn't send any additional data when you do a GET request, the header Content-Length should not be sent at

X-Cache Header Explanation

折月煮酒 提交于 2019-12-06 16:41:53
问题 I was going through the firefox local cache folder and found a lot of files containing the X-cache header. Can someone explain the purpose of this header ? thanks 回答1: CDN ( Content Delivery Network ) adds X-cache header to HTTP Response. X-cache:HIT means that your request was served by CDN, not origin servers. CDN is a special network designed to cache content, so that usr request served faster + to unload origin servers. 回答2: X-Cache "is NOT a standard HTTP header field" according to HTTP

HTTP Headers for Chrome

会有一股神秘感。 提交于 2019-12-06 16:29:12
I'm attempting to allow the user to download a file, and it is working perfectly in Firefox. My problem becomes that in Chrome, it doesn't seem to accept the file name that I give in the header, it simply ignores it and creates something of its own, and I'm noticing that its sending double headers, which are identical. HTTP/1.1 200 OK Date: Tue, 11 Feb 2014 16:25:19 GMT Server: Apache/#.#.## (Linux OS) X-Powered-By: PHP/#.#.## Cache-Control: private Pragma: public Content-Description: File Transfer Content-Disposition: attachment; filename="Filename_3_from_2014_02_11_11_25_19_Custom.csv"

R + fromJSON - how to send headers info?

会有一股神秘感。 提交于 2019-12-06 16:22:05
How can I use fromJSON to send header info? For instance, this is how i request a json data from a server, but the server will require some authentication info from my side. public_key <- 'VzUZFW1cQzP08ovr5auZbXQduzE'; data <- fromJSON(paste('http://127.0.0.1:3000', "/output/data?public_key=", public_key, sep=""),flatten=TRUE) Is it possible with fromJSON or other packages? If you want to include extra http headers in your request, you should use a different method for getting the url content, and use fromJSON on the response. Example using the httr package on the Bing Web Search API: library