What is a RESTful service?

Thiago Lunardi 16 Reputation points
2019-11-01T12:30:18.957+00:00

What's the difference between REST and RESTful service?

How are they useful?

Is it an architecture pattern or application style?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,509 questions
0 comments No comments
{count} votes

7 answers

Sort by: Newest
  1. Tariq Ahmed 1 Reputation point
    2019-11-30T22:07:06.203+00:00

    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.

    0 comments No comments

  2. Kenneth Orwig III 1 Reputation point
    2019-11-01T21:01:50.907+00:00

    Hi @Thiago Lunardi

    There is no technical difference between the terms – you may as well have asked about “Color” vs. “Colorful”.

    REST is an architectural style with well defined constraints. That is, if your system does not conform to them, then it is not a RESTful system.

    Here are the constraints:

    • Statelessness – session-state is maintained by the client and the server never stores any client context between requests.

    • Uniform Interface – ultimately, clients should be able to enter, understand, and use a RESTful system knowing nothing more than the entry point.

    • Client-Server Architecture – This shouldn’t really need much explanation: decoupling a UI from the application and storage allows for simpler interactions and reusability of component application segments.

    • Cacheability – Can be implemented on the client or server side and must be declared in every case.

    • Layered System – APIs may be deployed to one server although the processing, storage, authentication, and other concerns may happen elsewhere.

    • OPTIONAL: code on demand – when returning static representations pf resources in JSON or XML won’t do, just go ahead and return executable code – you are allowed.

    Here are a few other useful points:

    • REST is often compared to SOAP but this is like comparing apples to oranges. SOAP is a protocol – REST is not.

    • REST is protocol independent. We often use it with HTTP but we could just as easily use a different protocol for a different purpose.

    • A good understanding of hypermedia and HATEOAS is crucial to getting the Uniform Interface constraint satisfied effectively.

    • No one is going to grade you on how well your system conforms to REST and occasional deviations are encountered in even the most sophisticated systems. Just know that the closer you get to pure REST, the longer you can expect your application to remain relevant to your organization.

    Hope this helps!

    0 comments No comments

  3. Eric Gruss 16 Reputation points
    2019-11-01T14:35:55.517+00:00

    A RESTful service is an implementation that follows the patterns of REST. GET, POST, UPDATE, DELETE.
    If you are using a POST statement to do a delete, I would not call it RESTful even though it is a REST endpoint.

    3 people found this answer helpful.
    0 comments No comments

  4. David Hollowell -MSFT 21 Reputation points
    2019-11-01T14:28:33.777+00:00

    Hi ThiagoLunardi,
    I hope you're doing well. There's no difference between REST and RESTful. If a service follows REST principles it is said to be a RESTful service. See https://learn.microsoft.com/en-us/azure/architecture/best-practices/api-design for more information about REST principles.

    2 people found this answer helpful.
    0 comments No comments

  5. Robert Horvick 11 Reputation points
    2019-11-01T14:22:54.823+00:00

    "Web services that conform to the REST architectural style" are called "RESTful Web services". So when you ask what the difference is the answer is that it's just a syntax difference.

    You could say:

    "I wrote a web service that conforms to the REST architectural style"

    Or you could say:

    "I wrote a RESTful web service"

    And they mean the same thing.

    Is REST useful? Sure. It's proven itself to be pretty useful. It's not the only option but it's a popular one.

    2 people found this answer helpful.
    0 comments No comments