You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Elias2012 <el...@yahoo.com> on 2012/05/31 17:51:08 UTC

getParameters() from URL

to login my code is:

PostMethod post = new PostMethod("/admin/");
	
		NameValuePair[] data = {
				new NameValuePair("userName", userName),
				new NameValuePair("password", password)
				};

		post.setRequestBody(data);
               client.executeMethod(post);

I am searching for a way to get the name of the parameters from URL (not the
value).
ex: userName and password . any idea!! :) 
-- 
View this message in context: http://old.nabble.com/getParameters%28%29-from-URL-tp33939261p33939261.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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


Re: getParameters() from URL

Posted by kim young ill <kh...@googlemail.com>.
use java.net.URL, get the query-string & parse it with pattern
key1=value1&key2=value2...


hth



On Thu, May 31, 2012 at 5:51 PM, Elias2012 <el...@yahoo.com> wrote:

>
> to login my code is:
>
> PostMethod post = new PostMethod("/admin/");
>
>                NameValuePair[] data = {
>                                new NameValuePair("userName", userName),
>                                new NameValuePair("password", password)
>                                };
>
>                post.setRequestBody(data);
>               client.executeMethod(post);
>
> I am searching for a way to get the name of the parameters from URL (not
> the
> value).
> ex: userName and password . any idea!! :)
> --
> View this message in context:
> http://old.nabble.com/getParameters%28%29-from-URL-tp33939261p33939261.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>