Rails application Webservices

K

kevid

hi all,

I have a rails application at http://electric-sky-98.heroku.com/products

require 'net/http'
require 'uri'
res = Net::HTTP.get_response(URI.parse('http://electric-
sky-98.heroku.com/products.xml'))
puts res.body

the above code gave me the xml file below:

<?xml version="1.0" encoding="UTF-8"?>
<products type="array">
<product>
<brand>Tubers</brand>
<created-at type="datetime">2010-10-30T01:35:48Z</created-at>
<id type="integer">1</id>
<name>Yam</name>
<price>£ 30</price>
<quantity>100 tubers</quantity>
<sku>WDW332</sku>
<updated-at type="datetime">2010-10-30T01:35:48Z</updated-at>
</product>
</products>

QUESTION:::
How do i create a new product object at http://electric-sky-98.heroku.com/products
with ruby HTTP POST
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,145
Latest member
web3PRAgeency
Top