3 ms·
Are there any prior examples of sending multiple status codes in one response? I didn't think you could, but there's not much discussion of it in the draft (a l
by pebers 9y ago
Are there any prior examples of sending multiple status codes in one response? I didn't think you could, but there's not much discussion of it in the draft (a little in section 3 only) which makes me think it's not seen as controversial. Seems like it'd be a heap of work to update all the servers and clients out there if it's not supported already?
- aexaey 9y agoYes. "100 Continue". [1] If client intends to send a POST request with request body large enough to try to avoid wasting bandwidth (in case server might reply with 3xx,4xx or 5xx), the client will send only headers including "Expect: 100-continue" header, then server indenting to reply with "200 OK", will instead first reply with "100 Continue" than client will send POST body, and finally server sends "200 OK". [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3 https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8....
- xg15 9y agoAll 1xx responses are supposed to be sent like this - though "all" doesn't mean much as I think only two (100, 101) are defined in HTTP. Other derived protocols (e.g. WEBDAV) have additional ones though. Also the exchange seems to be subtly different for each of them: 100 Continue: Client sends start of request, server sends 100, client sends rest of request. 101 Switching Protocols: Client sends request, server sends 101, client sends non-http request. 103 Early Hints: Client sends request, server sends 103, server sends response.