hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: RequestLine's getUri() Return Type
Date Thu, 16 Jun 2011 19:42:35 GMT
On Thu, 2011-06-16 at 09:50 -0400, Bill Speirs wrote:
> Why does RequestLine's getUri() return a String instead of a URI
> (http://download.oracle.com/javase/6/docs/api/java/net/URI.html)
> object? I find that most of the time when I'm calling getUri() I just
> turn around and create a URI Object so I can parse out the pieces I
> need: schema, port, etc.
> I also noticed that BasicRequestLine, for example, doesn't perform any
> validation on the URI. If RequestLine was changed to return a URI
> object, it would necessitate the validating (through creating the URI
> object) of the URI.
> Thoughts?
> Bill-


There are (were) mainly two reasons for that. Initially HttpCore (based
on classic I/O) was designed to be Java 1.3 compatible (in hindsight
that was probably a mistake but it is too late now). java.net.URI is a
Java 1.4 class. Another reason was to allow the use of non-URI
identifiers in requests. This may be especially handy building HTTP like


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

View raw message