I need to access xml that is located in another web server. Does rails/ruby have a function that allows me to access this xml and then may be store it in a variable so that i can process it with libxml-ruby?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are a number of Ruby-level libraries to access remote HTTP resources. The oldest is Net::HTTP
Once you’ve received the xml, use Hpricot or other options to parse it.
Added:
Remember that you probably don’t want to make your clients wait while your Rails server queries another server. Cache your XML results if you can, or fetch the XML in the background.