hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: GET METHOD
Date Sat, 31 Jan 2009 12:03:22 GMT
Joan Balagueró wrote:
> Hello Oleg,
> 
> Yes, I saw it, but I also saw "Returns a String that is suitable for use as
> an application/x-www-form-urlencoded  list of parameters in an HTTP PUT or
> HTTP POST". PUT and POST, but it does not say anything about GET. But now I
> suppose that this string is also suitable for use with GET.
> 

Joan,

Javadocs are misleading. String generated by this method can also be 
used as a query component in request URIs.

Oleg

> Thanks,
> 
> Joan.
> 
>  
> -----Mensaje original-----
> De: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Enviado el: jueves, 29 de enero de 2009 23:44
> Para: HttpClient User Discussion
> Asunto: Re: GET METHOD
> 
> Joan Balagueró wrote:
>> Hello,
>>
>>  
>>
>> With HttpClient 3, I set a NameValuePair[] to the Get method using 
>> “setQueryString”.
>>
>>  
>>
>> Which is the way in HttpClient 4 to do the same? I’ve tried to find any 
>> sample after looking at the api and the documentation, and I’m not able 
>> to find out how to do this.
>>
>>  
>>
>> Thanks,
>>
> 
> Joan
> 
> You can use URLEncodedUtils#format method to generate a query string 
> from an array of NameValuePairs
> 
> http://hc.apache.org/httpcomponents-client/httpclient/apidocs/org/apache/htt
> p/client/utils/URLEncodedUtils.html#format(java.util.List,%20java.lang.Strin
> g)
> 
> Hope this helps
> 
> Oleg
> 
> 
>> 	
>>
>> *JOAN BALAGUERÓ *
>>
>> *GRUPO VENTUS*
>>
>> C/ Balmes 195, 4º 4ª // 08006 BCN
>> Telf.: 902 43 05 75 // Fax: 93 292 01 49
>>
>> www.grupoventus.com <http://www.grupoventus.com>
>>
>>  __
>>
>>  
>>
>>  
>>
>>  
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


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


Mime
View raw message