HTTP client to post XML RAW_DATA to restful API

Hey

I am trying to find out how to send an XML in string as RAW_DATA to a
RESTful API.

I found out a couple of libraries (Nestful, Restfulclient, curb) but
wasn't able to send the content properly as you'd send it from Rails
Functional tests @request.env['RAW_POST_DATA'] = xml.to_s

Any suggestions?

Costa

···

--
Posted via http://www.ruby-forum.com/.

Costa Nicolaou wrote:

Any suggestions?

restclient can do this. Otherwise, just use Net::HTTP directly.

···

--
Posted via http://www.ruby-forum.com/\.

Brian Candler wrote:

Costa Nicolaou wrote:

Any suggestions?

restclient can do this. Otherwise, just use Net::HTTP directly.

Cheers for that

Any examples? although the docs are quite good, it is not clear how to
send the XML string as RAW_DATA

···

--
Posted via http://www.ruby-forum.com/\.

Costa Nicolaou wrote:

Brian Candler wrote:

Costa Nicolaou wrote:

Any suggestions?

restclient can do this. Otherwise, just use Net::HTTP directly.

Cheers for that

Any examples? although the docs are quite good, it is not clear how to
send the XML string as RAW_DATA

Which, restclient or Net::HTTP?

Both take a string as an argument for the body data to post. A string is
raw data.

So I suggest you start by writing some code, preferably as a small
standalone program. If it fails then you can show the code and the
complete error message you see.

···

--
Posted via http://www.ruby-forum.com/\.