Hi Roland,
Just started to fiddle around with this tonight. It's pretty much all
new to me so I don't have too much to add just yet. I started by
trying to do a simple GET. Here's what I did:
SchemeRegistry schmreg = new SchemeRegistry();
Scheme http = new Scheme
("http", PlainSocketFactory.getSocketFactory(), 80);
schmreg.register(http);
DefaultHttpClient client = new DefaultHttpClient(
new BasicHttpParams(),
new SimpleClientConnManager(new BasicHttpParams(), schmreg),
schmreg
);
HttpGet get = new HttpGet("/");
HttpResponse resp = client.execute(new HttpHost("www.google.com"), get);
System.out.println(resp.getStatusLine().toString());
resp.getEntity().consumeContent();
This worked except that the default port for HTTP was not used
correctly. I make a quick fix to DefaultClientConnectionOperator and
checked that in. Hope that's okay.
Next I tried adding:
client.getProcessor().addInterceptor(new RequestTargetHost());
This one failed as the HttpContent doesn't include an entry for
HttpExecutionContext.HTTP_TARGET_HOST. I wasn't sure what the plan
was for managing HttpContext, so I didn't fix this one.
I will poke around and let you know what else I find. Overall things
look pretty good from what I've seen. One more quick question, is
there a plan to add a simple HTTP server in HttpClient like we did in
3.0 for testing?
Thanks,
Mike
On 2/20/07, Roland Weber (JIRA) <[EMAIL PROTECTED]> wrote:
[
https://issues.apache.org/jira/browse/HTTPCLIENT-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roland Weber closed HTTPCLIENT-627.
-----------------------------------
Resolution: Fixed
The API in org.apache.http.conn is ready for review. The connection manager
implementations in o.a.h.impl.conn are stuck in transition and need more work.
I'll clean up smaller things while writing test cases and leave the big one
(HTTPCLIENT-636) until we've got test coverage.
In org.apache.http[.impl].client are skeletons for HttpClient and
HttpRequestDirector. They are good enough to make use of the connection
managers and to communicate directly or via tunnelled TLS/SSL through a proxy
as long as no authentication is required.
cheers,
Roland
> overhaul connection manager and associated connection interface
> ---------------------------------------------------------------
>
> Key: HTTPCLIENT-627
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-627
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpConn
> Reporter: Roland Weber
> Assigned To: Roland Weber
> Priority: Critical
> Fix For: 4.0 Alpha 1
>
>
> MultiThreadedHttpConnectionManager/HttpHostConnection needs to be overhauled
to provide a layer on top of OperatedClientConnection.
> Preliminary working names: ThreadSafeClientConnManager/ManagedClientConnection
> This implies some work on former HttpMethodDirector and HttpClient to verify
completeness of the new connection management API.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]