Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Payload in restful webservices

 
sammeta Phanikumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have following doubt in the Restful web service. Please help me to clear on these.

1) In the restful web services all the request data is sent as an xml file in the HTTP protocol as pay load...

My doubt is

*** Does not HTTP pay load has a limit? if Yes...if bulk of data needs to be sent over...how can we solve this.

Thanks in advance.

Regards,
Phani
 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case of POST HTTP method, a payload (XML) does not have limits (this is how HTTP designed).

In case of GET (resource retrieval operation), you most likely will be using only URI to identify resource and won't use XML.

If you want to send data via GET method (in query string) - you are limited by couple of kilobytes (exact size depends on server and browser).
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Concerning retrieval of data with RESTful web services:
HTTP may not be limiting the amount of data you can retrieve - after all, you can download very large files over HTTP.
However, due to performance issues, you may want to limit the amount of data retrieved for instance when constructing a list or some overview of the available resources and later allow users to further drill down into details. You can use the following methods to accomplish this:
  • If you are retrieving a representation of objects structured in a tree you can limit the depth using a parameter in the URL. Representation of resources at a depth deeper than the depth supplied are not provided, instead the URI of the resource is inserted.
    For example, you want to retrieve a customer list, but you are not interested in the orders associated with each customer, then set the depth to 1. If you later want to view an order that belongs to a certain customer, then you retrieve it using the URI included in the representation of the customer list.
  • If the objects for which you want to retrieve a representation contain a lot of data in the root, you can:
    - Use a parameter in the URL that indicates that you want to retrieve a lightweight representation of the data, only including certain key fields.
    - Set up an additional resource being a lightweight version of the resource in question. I haven't tried this one and am a little skeptical regarding how to solve navigation between the lightweight version of the resource and the regular version.

  • Regarding limiting the amount of data when modifying existing resources:
    You can implement the modification operation as to accept key data uniquely identifying a resource and limit the enclosed data to only the fields in the resource that are to be modified. For instance, if you want to modify the address of a customer, you issue a request containing a representation of a customer containing only the customer id and the new address. The result of the operation is that the address is modified while the other fields remain unchanged.
    Best wishes!
     
    sammeta Phanikumar
    Ranch Hand
    Posts: 81
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Many Thanks Mikalai Zaikin and Ivan.

    I understood that HTTP does not have limit but for performance we can drill the data and send accross.

    Phani
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic