Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:31:09+00:00 2026-06-14T07:31:09+00:00

n00b REST question. I’m making a GET request to an API’s endpoint and getting

  • 0

n00b REST question. I’m making a GET request to an API’s endpoint and getting the proper XML response. The question I have is, how do I get the value of a particular XML element in the servers REST response using Ruby?

So let’s say one of the elements is ‘Body’ and I want to assign its value ‘Blah blah blah’ to a variable

Part of the XML response:

<Body>Blah blah blah</Body>

How would I do that with the response? Basically I want to do something like this

variable = params["Body"]

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:31:12+00:00Added an answer on June 14, 2026 at 7:31 am

    The best solution is to use RestClient or HTTParty and have it parse the response for you.

    Otherwise, you’ll have to parse the response itself using a library such as Nokogiri:

    doc = Nokogiri.XML(response)
    variable = doc.at("body").text
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Totally n00b question, Im making my first ASP.NET website, with the added twist of
I have a very n00b question about Rails. What are the variables and methods
this is a silly n00b question but i just don't get it to work.
This is probably a n00b question, but nontheless... I have a bit of a
I have a very simple (n00b) question. A 20-bit external address bus gave a
Blatant n00b question: I have several directories of pictures and wish to display randomly
N00b question: I'm using Symfony with Doctrine. I have a form where I've added
this is a complete n00b question and i understand i may get voted down
this is probably a n00b question, but I don't really have any experience in
I apologize in advance for the n00b question. I am just getting started w/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.