Rails application Webservices

Discussion in 'Ruby' started by kevid, Oct 31, 2010.

  1. kevid

    kevid Guest

    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
     
    kevid, Oct 31, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Schuerig
    Replies:
    3
    Views:
    227
    Carl Youngblood
    Jun 17, 2005
  2. Replies:
    0
    Views:
    113
  3. Josef 'Jupp' SCHUGT
    Replies:
    5
    Views:
    178
    Stephan Kämper
    Jan 24, 2006
  4. snacktime

    webservices status in rails

    snacktime, Nov 20, 2006, in forum: Ruby
    Replies:
    4
    Views:
    101
    snacktime
    Nov 22, 2006
  5. Banaganapalle, Zafer [DAS]

    WebServices in Rails

    Banaganapalle, Zafer [DAS], Feb 12, 2009, in forum: Ruby
    Replies:
    1
    Views:
    107
    Luc Evers
    Feb 12, 2009
Loading...

Share This Page