Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are RESTful web services? [duplicate]

Possible Duplicate:
What exactly is RESTful programming?

What are RESTful web services? What would be an example of it?

What is the difference between the asmx web services and the WCF RESTful service?

like image 204
Pranay Rana Avatar asked Sep 03 '10 13:09

Pranay Rana


People also ask

How to Avoid duplicate post request?

Using the Idempotency feature is a way of preventing data corruption caused by sending duplicate requests. To send a post request that is "Idempotent safe", simply include an idempotency_key header. The idempotency_key must be unique and should only be used in one request.

How do I stop multiple API calls?

On clicking on tabs you interchange state and you use ngOnInit() method every time when a state is changed to get the data.In this way, you can reduce API calls by using nested routing.

How do I avoid the same request for multiple times to the server?

You can't stop the user from resubmitting a new request with the same ticket, but you can reject it on the server side, with a "Duplicate request" error. Right, but people do that on purpose - submit a form, press back because they know they need to correct something, submit form again.


1 Answers

REST is a client-server architecture which (among other things) leverages the full capacity of the HTTP protocol.

Some relevant points in REST:

  • Each URL on the server represents a resource; either a collection resource or an element resource.
    • A collection resource would be available at a URL like http://restful.ex/items/ which would be a representation of a list of items.
    • A element resource would be available at a URL like http://restful.ex/items/2 which would be a representation of a single item, identified by 2.
  • Different HTTP methods are used for different CRUD operations:
    • a GET is a read operation
    • a PUT is a write/modify operation
    • a POST is a create/new operation
    • a DELETE is a... ok, that one is kind of self-explanatory.
  • State (or rather, client context) is not stored on the server-side; all state is in the representations passed back and forth by the client's requests and the server's responses.
like image 55
Richard JP Le Guen Avatar answered Sep 22 '22 21:09

Richard JP Le Guen