On 7/15/11 1:47 PM, Jon Brisbin wrote:
> I'm writing an HTTP REST server in Grizzly and curl wants to send an
> "Expect: 100-continue" header by default.
>
> I'm not at all sure how to handle this on the Grizzly end. When I
> guessed at what to do and sent a 100 response, the body of my upload
> was always blank.
>
> Any suggestions on how I need to handle 100-continue responses when
> accepting HTTP/1.1 uploads in Grizzly?
>
>
> Thanks!
>
> Jon Brisbin
> http//jbrisbin.com
>
>
HttpHandler.sendAcknowledgement() (line 311) has behavior to handle
this. This method can be overridden by custom handlers to customize the
behavior. This method is called at line 137. So this should be handled
for you.
However, there is a case where this acknowledgement process will be
ignored - this will occur when the user-agent sents the POST/PUT with
the Expect header and includes content from the request body.
If you don't try to handle this yourself, does the upload work? Have
you used something like wireshark or ngrep to ensure the "conversation"
between the user-agent and the server are as you would expect it for
this use case?
[1] *
http://tinyurl.com/6aoknz4*