Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Expect header 100-continue for put requests #82

Closed
harshavardhana opened this issue Jan 15, 2016 · 3 comments
Closed

Set Expect header 100-continue for put requests #82

harshavardhana opened this issue Jan 15, 2016 · 3 comments

Comments

@harshavardhana
Copy link
Member

     [java] DEBUG [org.apache.http.headers] >> Expect: 100-continue
     [java] DEBUG [org.apache.http.wire]  << "HTTP/1.1 100 Continue[\r][\n]"
     [java] DEBUG [org.apache.http.wire]  << "[\r][\n]"
     [java] DEBUG [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 100 Continue
     [java] DEBUG [org.apache.http.headers] << HTTP/1.1 100 Continue
@harshavardhana
Copy link
Member Author

8.2.3 Use of the 100 (Continue) Status

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, it might either be inappropriate or highly inefficient for the client to send the body if the server will reject the message without looking at the body.

Requirements for HTTP/1.1 clients:

  - If a client will wait for a 100 (Continue) response before
    sending the request body, it MUST send an Expect request-header
    field (section 14.20) with the "100-continue" expectation.
  - A client MUST NOT send an Expect request-header field (section
    14.20) with the "100-continue" expectation if it does not intend
    to send a request body.

@harshavardhana
Copy link
Member Author

To keep note of while implementing this feature - https://tools.ietf.org/html/rfc7231#page-35

      A client that receives a 417 (Expectation Failed) status code in
      response to a request containing a 100-continue expectation SHOULD
      repeat that request without a 100-continue expectation, since the
      417 response merely indicates that the response chain does not
      support expectations (e.g., it passes through an HTTP/1.0 server).

@harshavardhana
Copy link
Member Author

This is not a necessity anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant