Oleg Kalnichevski wrote:

On Wed, Nov 16, 2005 at 10:22:02AM -0500, Rob Manning wrote:
I'd like to be able to tell HttpClient to only speak HTTP/1.1 with the server and throw an Exception if the server doesn't support this. I see in the preferences api document (http://jakarta.apache.org/commons/httpclient/preference-api.html)
where I can set the default protocol to use via the HTTP method parameter
called "http.protocol.version". However, I suspect this will only "prefer" HTTP/1.1
and not "prevent" speaking HTTP/1.0.  Anyone have any ideas about how I
would achieve this?


Rob,

Just override the HttpMethodBase#readStatusLine(HttpState,
HttpConnection) method and throw an exception if the effective protocol
version is set to HttpVersion.HTTP_1_0

http://jakarta.apache.org/commons/httpclient/xref/org/apache/commons/httpclient/HttpMethodBase.html#1821

Hope this helps
Oleg,

Thanks as always for a quick response.  I expect that will work just fine.

Rob


CollabraSpace - Revolutionary Collaboration
Visit us at http://www.collabraspace.com
This message has been scanned for viruses by
ClamAV v0.83



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to