hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Apple's IPP, and Expect: 100-continue
Date Mon, 09 May 2011 20:58:16 GMT
On Mon, 2011-05-09 at 16:26 -0400, John Kiffmeyer wrote:
> Hi httpclient-users,
> 
> I'm currently using HttpClient 4.1 to send IPP messages.  I've encountered
> IPP implementations (most notably, implementations by Apple) that use the
> Expect: 100-continue header mean, "here's an HTTP request with an IPP
> Print-Job request inside it, reply with 100 Continue to receive the job
> data."
> 
> So in general terms, the client's initial HTTP request with (Expect:
> 100-continue set) has part of the entity, and the rest of the entity is sent
> after the server replies with 100 Continue.  The rfc that defines Expect:
> 100-continue seems to indicate that's not legal, but Apple's IPP
> implementation does it.  (The reference implementation for IPP, no less. =/)
> 
> My question is: Can I make HttpClient do this?  It (understandably) seems
> like there's no way to define where to break an entity over a 100 Continue,
> or a way to define two entities for before/after 100 Continue.  Is this
> possible (maybe with some subclassing)?
> 
> Thanks!
> john
> 

John



It is not going to be easy. If you are lucky you might just get away
with subclassing HttpRequestExecutor and overriding its #doSendRequest
method. 

http://hc.apache.org/httpcomponents-core-ga/httpcore/xref/org/apache/http/protocol/HttpRequestExecutor.html

I do suspect, though, you will need a custom connection class capable of
writing out entities in chunks. Stock HttpConnection classes are
designed to stream out request bodies within one method call which may
be inapplicable in your case.

I also suspect you might have a hard time integrating those custom
classes into HttpClient so probably you should consider building a whole
new custom HTTP client based on HttpCore components and then re-using
bits of HttpClient such as authentication components should you really
need them:

http://hc.apache.org/httpcomponents-core-ga/tutorial/html/fundamentals.html

Hope this helps

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message