hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Parsing http parameters
Date Sat, 28 Jul 2007 13:32:59 GMT
On Sat, 2007-07-28 at 14:28 +0200, Marcus Herou wrote:
> Cool.
> 
> Then I guess I should extend the HttpUriRequest instead ?
> 
> Something like this perhaps ?
> public interface ParsedHttpRequest extends HttpUriRequest
> {
>    Map<String, String[]> getParameters();
>    String getParameter(String name);
> }
> 
> Hmmm... No not involving httpclient into something which should be more
> core... and httpclient sound bad for something which resides on the server
> :)

A utility class may also be an alternative. QueryStringParser?

> I think actually I will make a merge of httpclient's HttpUriRequest with the
> ParsedParameterRequest and put it in a package named something like
> org.apache.http.* somewhere.
> 
> Re:
> "How about moving socket initialization code from SocketHttp*Connection
> to DefaultHttp*Connection classes? Would that address the issue?"
> 
> Hmm well yes an extension which only binds the socket, why not. However the
> socket is private in the Socket* so "this.socket=socket" cannot be setup
> from an extended class... That's why I did'nt subclass the DefaultHttp*
> class in the first way. Any thoughts ?

How about subclassing SocketHttp*Connection instead of
DefaultHttp*Connection? See the patch attached


>  Looked at my code ?
> 

Yes, I did. I would prefer a solution which would not require a new
parameter, though.

Oleg

> Kindly
> 
> //Marcus
> 


Mime
View raw message