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 3614126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:12:34+00:00 2026-05-18T22:12:34+00:00

I am using rest-client to make restful API calls. My response can be either

  • 0

I am using rest-client to make restful API calls. My response can be either in JSON or XML.

How can I easily parse the responses? It is pulling Company and Contact information.

Is there a way to treat each XML record as an object, so I can access the tags as methods?

What is the recommended way to access and traverse the response I get back, and is it XML or JSON as the recommended format?

  • 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-05-18T22:12:35+00:00Added an answer on May 18, 2026 at 10:12 pm

    In the Readme of the ‘maintained’ github repo for the ruby version of rest-client, there is a section on handling results.

    Are you calling two different APIs? I’m unsure of how one API would be both returning XML and/or JSON?

    Personally, I’d make the call with rest-client (instead of net::http or something) and then use REXML to then parse the information I needed.

    example (hypothetical with no code):

    
    api_call = RestClient.get 'http://example.com/resource'
    xml  = REXML::Document.new(api_call)
    #parse xml here
    

    For information on parsing with REXML check out this tutorial

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using django-rest-interface to build an API. However, when I make a request through
I'm using the Spring RESTTemplate on the client side to make calls to a
i am using this tutorial to make android as a Rest client . The
I want make RESTful services using embedded jetty with JAX-RS (either resteasy or jersey).
I'm currently using Jersey as a proxy REST api to call another RESTful web
I am trying to make a REST client from django using httplib . But
I'm looking to implement a REST client in PHP, and have previously been using
I'm trying to make a simple class for my REST calls so I won't
As I understand it, using a hypertext-driven RESTful Web service, a client is not
I'm using the Jersey Client library to run tests against a rest service running

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.