http-1.1

HTTP/1.1 response to multiple range

自作多情 提交于 2020-01-12 14:23:18
问题 While writing my HTTP/1.1 server, I get stuck dealing multiple ranges request. Section 14.35.1 of RFC 2616 refers some examples but doesn't clarify server behaviour. For instance: GET /some/resource HTTP/1.1 ... Range: bytes=200-400,100-300,500-600 ... Should I return this exact sequence of bytes? Or should I merge all ranges, sending 100-400,500-600 ? Or sending all in between, 100-600 ? Worst, when checking Content-Range response header (Section 14.16), only a single range may be returned,

Supporting HTTP 100 Continue with PHP

不想你离开。 提交于 2020-01-01 02:29:27
问题 I'm working on a PHP webapp that accepts large POSTed file uploads from specific clients and would like to accept or reject these uploads (based on various headers and other factors, not just size) before the file is uploaded by using HTTP/1.1 100 Continue. Some quick background from HTTP/1.1 spec 8.2.3: The purpose of the 100 (Continue) status (see section 10.1.1) is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept

file_get_contents() with context to use http/1.1 significantly slow download speeds

南笙酒味 提交于 2019-12-30 08:29:09
问题 Using the code below each image download) file_get_contents() ) takes on average 8-15 seconds..... If I do not use a context on file_get_contents() then image download is less than a second. If I change the $opts to, below then i get same performance as file_get_contents() without a context which takes appox 13 seconds to process 2,500 imagesx. $opts = array( 'http'=>array( 'protocol_version'=>'1.1', 'method'=>'GET', 'header'=>array( 'Connection: close' ), 'user_agent'=>'Image Resizer' ) );

HTTP pipelining request text example

落花浮王杯 提交于 2019-12-29 04:19:18
问题 Below is an example HTTP 1.1 call with a single page requested : GET /jq.js HTTP/1.1 Host: 127.0.0.1 Accept: */* I understand with HTTP Pipelining, multiple requests can be sent without breaking the connection. Can someone post, some text example of how this request will be sent to the server, I want to be able to do it over the command line or with PHP sockets. Does support for pipelining need to enabled on the web-server as well? Is pipelining supported by major Web-servers(apache, nginx)

IE receiving HTTP 1.0 response for some files

匆匆过客 提交于 2019-12-25 08:57:29
问题 I've included an audio and video player (html5 with flash fallback) which works in all browsers except IE. While looking for the problem I found that the server sends "HTTP/1.0 200 OK" and "Connection:close" headers (and no Content-Length), but only in IE and only for some files (including .swf, .mp3 and .mp4). I have added the following to .htaccess to disable gzip for those files: <IfModule mod_env.c> SetEnvIfNoCase Request_URI "\.(?:mp3|mp4)$" no-gzip dont-vary </IfModule> I have no

Read status line (status code and reason phrase) using AFNetworking's AFHTTPRequestOperation

拟墨画扇 提交于 2019-12-24 10:56:57
问题 I am switching from ASIHTTPRequest to AFNetworking in an iOS application. RF2616 (HTTP/1.1) defines a "status-line" by the combination of "Status Code" and "Reason Phrase". Sometimes the server adds some specific information in this "Reason Phrase" and I found it rather handy that ASIHTTPRequest allowed me to access it easily via ASIHTTPRequest *request = ...; NSString *reason = request.responseStatusMessage; My problem is that I can't find any way to do it with AFHTTPRequestOperation

PHP: Get HTTP Protocol Version (HTTP/1.1 vs HTTP/2)

和自甴很熟 提交于 2019-12-24 01:26:00
问题 Until now my php application assumed HTTP 1.1 everywhere. So I defined all headers like so: header("HTTP/1.1 500 Internal Server Error"); But now my server also supports HTTP 2 and I want to update all header responses with the right HTTP status code. How to I get the HTTP Protocol version of the http request? (My webserver is nginx, but I guess it is irrelevant if I am using nginx or apache.) 回答1: The server protocol should be available through SERVER_PROTOCOL from the server environment,

Why does Wget have Host Header in its HTTP request?

隐身守侯 提交于 2019-12-24 00:28:47
问题 The main difference between HTTP/1.0 and HTTP/1.1 is that HTTP/1.1 has a mandatory Host header in it (source: HTTP Pocket Reference - O'reilly). So, why is that Wget, which uses the HTTP/1.0 protocol, has a host header in it? My output of Wget with netcat: GET / HTTP/1.0 User-Agent: Wget/1.12 (linux-gnu) Accept: */* Host: 127.0.0.1:10101 Connection: Keep-Alive As it is clear that Wget uses the HTTP/1.0 protocol version, how can it have a host header in it? Or am I getting somewhere wrong with

What does the HTTP header If-None-Match: * mean?

瘦欲@ 提交于 2019-12-20 08:27:24
问题 What does the following HTTP 1.1 header mean? If-None-Match: * I understand it when using a strong or weak ETag or even a list of ETags, but I don't understant it's use when using star (*). Edit: Would be nice to have some pseudocode (PHP code good also) that would show how/what to answer to "If-None-Match: *". 回答1: The answer is: it depends. Suppose we have received If-None-Match: * If-Modified-Since: <yesterday date> And the page has been altered today . First, we take a look at the * which

Safari Sends Two HTTP Req. Same Time/Socket

痴心易碎 提交于 2019-12-20 04:35:06
问题 I have an IPad Safari sending two HTTP requests (two different PNG) files within 30 ms. I thought that even on a Keep Alive HTTP 1.1 connection there should be a clear sequence of request/response. What I saw is that the Safari browser sends two GET requests within 30 ms without waiting for an answer. This causes problems in some web servers. Situation: I have an HTML5 loading an SVG with further references to other images (like PNG and GIF). The problem does not occur on IPhone 5 but on the