commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: [HttpClient] Relative URI
Date Tue, 19 Oct 2004 12:09:09 GMT
Please have a look at the httpclient URI class.  Something like the 
following should work:

URI newURI = new URI(new URI("/test.html"), "member/login");

You can then query the newURI for the values you need.

Mike

On Oct 18, 2004, at 9:29 PM, h2ooo x wrote:

> From the HTML, I grabbed the line src="member/login" and sent a 
> request to it and, the response said "400 Bad Request".
>
> The problem is solved by adding a prefix to the address like this, 
> "/member/login":
>
>   // uri = "member/login"
>   if (uri.charAt(0) != '/')
>      uri = "/" + uri;
>
>   // uri = "/member/login"
>
>
> Do we have to do this programmatically?
> * I'm afraid if I have overlooked some useful HttpClient features to 
> make the code better.
>
> _________________________________________________________________
> Are you in love? Find a date on MSN Personals http://match.msn.com.my/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message