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 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

Related Questions

Why does this not work? Do I not understand delegate covariance correctly? public delegate
Do I understand correctly that CCLabelBMFont only loads the font texture once, no matter
If I understand it correctly this means extern void foo(); that the function foo
I am not sure if I understand the usage of crossdomain.xml correctly. I am,
really can't understand, how to build correctly project that uses boost.python. I've included boost_(python/thread/system)-mt.
I'm trying to understand how one should design middlewares for EWGI compatibility. Given that
If I understand correctly, in .NET the default implementation of Object.GetHashCode() returns a value
This is just a quick question to understand correctly what happens when you create
If I understand this correctly, the program counter points to the address of the
Been trying my best to understand this correctly. What is the difference between an

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.