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

  • Home
  • SEARCH
  • 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 233941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:08:40+00:00 2026-05-11T20:08:40+00:00

If I understand correctly, in rest style, every query (that is, every action on

  • 0

If I understand correctly, in rest style, every query (that is, every action on every resource that does not modifies the resource’s state) should be encoded in the query string, using a get method, with no body at all.

Am I right?

Well, I have several applications that communicate with the db thru an XML message that is handled by a Visual Basic 6 component.

the message for a query is something like this

<xml>
  <service>account</service>
  <resource>invoice</resource>
  <action>query</action>
  <parameters>
    <page>1</page>
    <page_len>10</page_len>
    <order>date</order>
    <fields>*</fields>
    <conditions>
      <date>2009-01-01..2009-01-31</date>
      <customer_id>24</customer_id>
    </conditions>
  </parameters>
</xml>

Right now we are in the process of redesigning our XML messages, and we’d like to do that in such a way that they could be easily mapped to a RESTful interface.

In the previous example, we need the “conditions” tags in order to prevent collisions between the parameters and the conditions (i.e., what happens if I have a field named “order”, “page” or something like that…

We though about sending the parameters with a prefix, something like

http://account/invoice/?_page=1&_page_len=10&_order=date&_fields=*&date=2009-01-01..2009-01-31&customer_id=24

and the XML would be something like

[...]
    <_order>date</_order>
    <_fields>*</_fields>
    <date>2009-01-01..2009-01-31</date>
    <customer_id>24</customer_id>
[...]

We are trying to define some really simple XML format for crud operations, and that the resulting XML could be easily mapped to rest or JSON.

How would you map that kind of query in a rest application? Is there some standard defined? or some page with crud rest / XML /JSON samples? how about returning error, or nested datasets?

Thanks a lot.

  • 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-11T20:08:40+00:00Added an answer on May 11, 2026 at 8:08 pm

    IMHO in order to make your system truly RESTful you must rethink all the messages/queries that you will send.

    This part:

    <conditions>
      <date>2009-01-01..2009-01-31</date>
      <customer_id>24</customer_id>
    </conditions>
    

    is the tricky part. What kind of other conditions do you have? Are there many? This particular example makes me think that you can treat invoices as a subresource of a customer. When I do rest I always try to identify resource in the path and if a query stil needs any parameters, I move them to query string. So I’d write something like this:

    GET /customers/24/invoices?start_date=2009-01-01&end_date=2009-01-31
    

    Think about relations between your resources. Let’s say we have resource type Foo related resource type Bar by a -to-many relation. In this case you can ask about this relation like this: GET /foo/123/bar and add query string parameters to filter it. The problem begins when you want to filter it in a way that involves relations to other resources. IMHO this means that your resource design isn’t truly RESTful.

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

Sidebar

Ask A Question

Stats

  • Questions 257k
  • Answers 257k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Click on Window, Show View, Error Log. Remove all projects… May 13, 2026 at 10:52 am
  • Editorial Team
    Editorial Team added an answer Making Parser a Monad is easy, and I think resorting… May 13, 2026 at 10:52 am
  • Editorial Team
    Editorial Team added an answer I had the same problem and found a solution in… May 13, 2026 at 10:52 am

Related Questions

as per wikipedia terms REST is REST can be considered the architectural style for
A bit of background: I am building an iPhone app with a complementary server
I am working on a 2D game using OpenGL ES. I am using the
I want to run a web application on php and mysql, using the CakePHP

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.