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

Costa Nicolaou wrote:

Any suggestions?

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

Brian C. 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

Costa Nicolaou wrote:

Brian C. 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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs