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 Suladna <su...@yahoo.com> on 2009/06/15 13:09:07 UTC
Simple call to URL to update data values
Hi!
I want to make simple calls to a URL in order to update some data values. The URL is as following:
http://www.myurl.com/test?param1=value1¶m2=value2¶m3=value3¶m4=value4
Is there any way to do this efficiently using HttpClient 4? (I will do the call to the URL every minute).
Best regards,
Sul Adna
P.S.
I have tried writing the following:
HttpClient client = new HttpClient();
PostMethod method = new PostMethod( "http://www.myurl.com/test" );
method.addParameter( "param1", "value1" );
method.addParameter( "param2", "value2" );
method.addParameter( "param3", "value3" );
method.addParameter( "param4", "value4" );
client.executeMethod( method );
... but it doesn't work (the website is not updated).
Re: Simple call to URL to update data values
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Jun 15, 2009 at 04:09:07AM -0700, Suladna wrote:
> Hi!
> ?
> I want to make simple calls to a URL in order to update some data values. The URL is as following:
> ?
> http://www.myurl.com/test?param1=value1¶m2=value2¶m3=value3¶m4=value4
> ?
> Is there any way to do this efficiently using HttpClient 4? (I will do the call to the URL every minute).
> ?
>
See HttpClient 4.0 tutorial, fundamentals
http://wiki.apache.org/HttpComponents/HttpClientTutorial
Oleg
Best regards,
> Sul Adna
> ?
> P.S.
> ?
> I have tried writing the following:
> ?
> HttpClient client = new HttpClient();
> PostMethod method = new PostMethod( "http://www.myurl.com/test" );
> method.addParameter( "param1", "value1" );
> method.addParameter( "param2", "value2" );
> method.addParameter( "param3", "value3" );
> method.addParameter( "param4", "value4" );
> client.executeMethod( method );
> ?
> ... but it doesn't work (the website is not updated).
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org