You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by funnysage <at...@gmail.com> on 2014/05/12 20:50:39 UTC

How to use WebClient for "curl -X PUT"

Hi,

I trying to integrate with a third party website. I am using CXF 2.6.2.
They have a webservice which documented as:

curl -X PUT https://someurl -H "some header" -d state="some state"

Now, what should i be setting as attributed for WebClient? and which API I
should use to call this webservice?

Thanks.



--
View this message in context: http://cxf.547215.n5.nabble.com/How-to-use-WebClient-for-curl-X-PUT-tp5743878.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: How to use WebClient for "curl -X PUT"

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

If you make non-proxy based call with headers and prepared body, org.apache.cxf.jaxrs.client.WebClient or javax.ws.rs.client.Client are optimal.

Code could look like:

WebClient wc = WebClient.create(address); 
wc.header(name, values);
wc.put(body);

Regards,
Andrei.

> -----Original Message-----
> From: funnysage [mailto:atulwagle@gmail.com]
> Sent: Montag, 12. Mai 2014 20:51
> To: users@cxf.apache.org
> Subject: How to use WebClient for "curl -X PUT"
> 
> Hi,
> 
> I trying to integrate with a third party website. I am using CXF 2.6.2.
> They have a webservice which documented as:
> 
> curl -X PUT https://someurl -H "some header" -d state="some state"
> 
> Now, what should i be setting as attributed for WebClient? and which API I
> should use to call this webservice?
> 
> Thanks.
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/How-to-use-
> WebClient-for-curl-X-PUT-tp5743878.html
> Sent from the cxf-user mailing list archive at Nabble.com.