I have to write a call from my rails app to an external URL : http://999:madmax-UiDqDuUr6vLOkh+dbi41W9BPR1lH4CV8@public.gmane.org/apis/media.php?action=createCollection&collection_id=123 then I should get back an XML answer , to be parsed (I need to reuse these info into my web app) <collection> <id>180</id> <partner_id>2</partner_id> <name>myNewCollection</name> <description>this is my new sports collection</description> <collection_type>static</collection_type> <thumbnail_media_id/> <token>7fd77f35ba63b07a19d8eb995d66215f</token> <parent_collection_id>123</parent_collection_id> <path>/123/180</path> </collection> where should I look for info on it ? as I don''t supply a return URL, I don''t know how to handle the answer in Rails ... thanks for your help.. yves -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mat Brown
2010-Feb-08 16:46 UTC
Re: How to write an outgoing URL call and get the XML response ?
You can use Net::HTTP, which is part of the standard Ruby library, to make the external request. REXML, also part of the standard library, can parse it, though I''d suggest using Nokogiri for that instead. On Feb 8, 2010 11:43 AM, "Erwin" <yves_dufour-ee4meeAH724@public.gmane.org> wrote: I have to write a call from my rails app to an external URL : http://999:madmax-UiDqDuUr6vLOkh+dbi41W9BPR1lH4CV8@public.gmane.org/apis/media.php?action=createCollection&collection_id=123 then I should get back an XML answer , to be parsed (I need to reuse these info into my web app) <collection> <id>180</id> <partner_id>2</partner_id> <name>myNewCollection</name> <description>this is my new sports collection</description> <collection_type>static</collection_type> <thumbnail_media_id/> <token>7fd77f35ba63b07a19d8eb995d66215f</token> <parent_collection_id>123</parent_collection_id> <path>/123/180</path> </collection> where should I look for info on it ? as I don''t supply a return URL, I don''t know how to handle the answer in Rails ... thanks for your help.. yves -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Erwin
2010-Feb-08 17:09 UTC
Re: How to write an outgoing URL call and get the XML response ?
thanks a lot, I am going to have a look at Nokogiri yves On 8 fév, 17:46, Mat Brown <m...-BtJC2HJPhyMAvxtiuMwx3w@public.gmane.org> wrote:> You can use Net::HTTP, which is part of the standard Ruby library, to make > the external request. REXML, also part of the standard library, can parse > it, though I''d suggest using Nokogiri for that instead. > > On Feb 8, 2010 11:43 AM, "Erwin" <yves_duf...-ee4meeAH724@public.gmane.org> wrote: > > I have to write a call from my rails app to an external URL : > > http://999:mad...-UiDqDuUr6vLOkh+dbi41W9BPR1lH4CV8@public.gmane.org/apis/media.php?action=createCollection&collection_id=12 3 > > then I should get back an XML answer , to be parsed (I need to reuse > these info into my web app) > > <collection> > <id>180</id> > <partner_id>2</partner_id> > <name>myNewCollection</name> > <description>this is my new sports collection</description> > <collection_type>static</collection_type> > <thumbnail_media_id/> > <token>7fd77f35ba63b07a19d8eb995d66215f</token> > <parent_collection_id>123</parent_collection_id> > <path>/123/180</path> > </collection> > > where should I look for info on it ? > as I don''t supply a return URL, I don''t know how to handle the answer > in Rails ... > > thanks for your help.. > > yves > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > . > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.