http-1.1

HTTP 1.1 - Can a client request that transfers not be “chunked”?

雨燕双飞 提交于 2019-12-03 20:48:46
问题 Is it possible for a HTTP 1.1 client to set a header value that indicates the responses to requests should not be chunked? Or is the only way to prevent this, is to send a HTTP 1.0 request? I've tried googling around, but all I can find is ways to disable chunked transfers on HTTP 1.1 servers, so I am guessing it is not possible on a client, but I thought I'd ask anyways. 回答1: In HTTP (starting with HTTP/1.1), recipients MUST support chunked encoding. See http://greenbytes.de/tech/webdav

Supporting HTTP 100 Continue with PHP

旧巷老猫 提交于 2019-12-03 10:50:49
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 the request (based on the request headers) before the client sends the request body. In some cases,

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

孤街浪徒 提交于 2019-12-02 17:15:42
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: *". 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 tells us: "Return 304 if the resource is there and condition (2) is met". Fine, the resource exists, BUT

Serving HTTP/1.0 responses with Node.JS (unknown content length, chunked transfer encoding)

杀马特。学长 韩版系。学妹 提交于 2019-12-01 02:45:02
The Problem I am serving a resource of unknown length via Node.JS. Because of this, the Content-Length header cannot be set. For HTTP 1.1, it is required that chunked encoding is used for resources of this nature. Node.JS knows this and sends my data with chunked transfer encoding all on its own, with the following headers: HTTP/1.1 200 OK Transfer-Encoding: chunked Connection: close ... This is all fine and good for well-behaved clients. However, I have some not-so-well behaved clients (namely Android 2.2 and earlier) that I must support. These clients do not support chunked transfer encoding

Serving HTTP/1.0 responses with Node.JS (unknown content length, chunked transfer encoding)

你。 提交于 2019-11-30 22:32:42
问题 The Problem I am serving a resource of unknown length via Node.JS. Because of this, the Content-Length header cannot be set. For HTTP 1.1, it is required that chunked encoding is used for resources of this nature. Node.JS knows this and sends my data with chunked transfer encoding all on its own, with the following headers: HTTP/1.1 200 OK Transfer-Encoding: chunked Connection: close ... This is all fine and good for well-behaved clients. However, I have some not-so-well behaved clients

Versioning a RESTful API with both XML and JSON Content-Type

丶灬走出姿态 提交于 2019-11-30 11:34:58
问题 According to this excellent presentation on designing RESTful interfaces, the preferred way to implement versioning is to utilize the Accept-header, using something like: GET /products HTTP/1.1 Host: example.com Accept: application/vnd.com.myservice.v2+xml This works perfectly for XML Content-Types, but is possible to use the same scheme for versioning the JSON-equivalent ? I.e, is it possible to ask for: GET /products HTTP/1.1 Host: example.com Accept: application/vnd.com.myservice.v2+json

HTTP if-none-match and if-modified-since and 304 clarification in PHP

半腔热情 提交于 2019-11-30 05:33:18
My question is about how to reply a HTTP 304 "Not Modified" when I receive both if-none-match and if-modified-since from a proxy/client request. From RFC 2616 secttion 14.26 ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26 ): If none of the entity tags match, then the server MAY perform the requested method as if the If-None-Match header field did not exist, but MUST also ignore any If-Modified-Since header field(s) in the request. That is, if no entity tags match, then the server MUST NOT return a 304 (Not Modified) response. I am not sure to understand this statement... "If

What if an HTTP/1.1 client talk to an HTTP/2 only server and what if an HTTP/2 client talk to an HTTP/1.1 only server?

让人想犯罪 __ 提交于 2019-11-30 03:32:12
问题 HTTP/2 is definitely the future trend because it is now the standard of HTTP protocol. As we can see in Can I use, 70.15 percent of browsers support the HTTP/2. But HTTP/2 is so new that there are browsers that only support HTTP/1.x and there are many servers that only support HTTP/1.x. I knew that a client can use HTTP upgrade mechanism to negotiate a proper protocol to communicate with the server. For example, if the server supports HTTP/2, their communicating protocol will switch to HTTP/2

HTTP if-none-match and if-modified-since and 304 clarification in PHP

梦想的初衷 提交于 2019-11-29 03:11:59
问题 My question is about how to reply a HTTP 304 "Not Modified" when I receive both if-none-match and if-modified-since from a proxy/client request. From RFC 2616 secttion 14.26 ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26 ): If none of the entity tags match, then the server MAY perform the requested method as if the If-None-Match header field did not exist, but MUST also ignore any If-Modified-Since header field(s) in the request. That is, if no entity tags match, then the

WebDAV - Request “Show files in folder”?

社会主义新天地 提交于 2019-11-28 07:33:42
问题 I want to download all *.txt files from a WebDAV share. Is there a request/methode to get a list of files from this folder? I´m new to WebDAV and at the w3.org WebDAV methode definition I don´t found this information. http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3 回答1: The link you pointed at is not the WebDAV specfication, but the HTTP specification. If you want to list the contents of a directory (collection) you must use the PROPFIND method instead, which should return an XML