Share via

What is a RESTful service?

Thiago Lunardi 16 Reputation points
Nov 1, 2019, 12:30 PM

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.
39,971 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Eric Gruss 16 Reputation points
    Nov 1, 2019, 2:35 PM

    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

  2. Robert Horvick 11 Reputation points
    Nov 1, 2019, 2:22 PM

    "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

  3. David Hollowell -MSFT 21 Reputation points
    Nov 1, 2019, 2:28 PM

    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

  4. Thiago Lunardi 16 Reputation points
    Nov 1, 2019, 12:37 PM

    REST

    According to Wikipedia:

    It is thought of how an image of the application design will behave.

    That is, it would be something like, depending on how you consume the same feature - a feature that can be visually identified inclusive - your behavior will change.

    Let's illustrate to facilitate:

    About HTTP Requests

    Every time we access something via browser, multiple requests are triggered. When you access any page, a request for the content of that page is created. When this content returns, the browser mounts (renders)the page, but this page requires other features such as images, fonts, stylesheets (css). For each feature, the browser will make a new request.

    These requests are composed mainly of three information:

    • URL: Address that will receive the request;
    • Verb/Method: Command that is desired to be made;
    • Body: Information we send, such as data from a form, for example.

    As many as the Verbs, there are 4 that are the most used:

    • GET: Used to bring information
    • POST: To create/add information
    • PUT: To tulize information
    • DELETE: To delete information ## RESTful Service

    They are services that have REST behavior. That is, using the same design, your behavior will change according to the way it is consumed

    For example, we have the URL(endpoint)below:

    http://www.contoso.com/students

    If we want to bring the list of students, just make a request: GET

    Request:  
    [GET] http://www.contoso.com/students  
    Body: empty  
    

    The answer will be something like:

    Response:  
    HTTP Code 200 OK  
    [  
        { id: 1, nome: "Thiago Lunardi" },  
        { id: 2, nome: "Joe Satriani"}  
    ]  
    

    But if I want to add a new student, I use the same design, but consuming otherwise, with a request: POST

    Request:  
    [POST] http://www.contoso.com/students  
    Body: { "nome: "Slash" }  
    
    HTTP Code 201 Created  
    { id: 3, nome: "Slash" }  
    

    Continuing, to learn more about a student:

    Request:  
    [GET] http://www.contoso.com/students/1  
    Body: empty  
    
    Response:  
    HTTP Code 200 OK  
    {   
        id: 1,   
        nome: "Thiago Lunardi",  
        github: "https://github.com/ThiagoLunardi",  
        website: "http://thiagolunardi.net",  
        blog: "https://medium.com/@thiagolunardi",  
    }  
    

    To update one-year information, in the same way, we use the same design, and we just change the way we consume the resource, and it will behave differently:

    Request:  
    [PUT] http://www.contoso.com/alunos/1  
    Body: { "twitter": "@thiagolunardi13" }  
    
    Response:  
    HTTP Code 200 OK  
    {   
        id: 1,   
        nome: "Thiago Lunardi",  
        github: "https://github.com/ThiagoLunardi",  
        website: "http://thiagolunardi.net",  
        blog: "https://medium.com/@thiagolunardi",  
        twitter: "@thiagolunardi13"  
    }  
    

    To delete:

    Request:  
    [DELETE] http://www.contoso.com/alunos/1  
    Body: empty  
    
    Response:  
    HTTP Code 204 No Content  
    

    PS: Translated from StackOverflow.

    1 person found this answer helpful.
    0 comments No comments

  5. Thiago Lunardi 16 Reputation points
    Nov 1, 2019, 12:51 PM

    REST

    According to Wikipedia:

    It is thought of as a image of the application design will behave.

    That is, it would be something like, depending on how you consume the same feature - a feature that can be visually identified inclusive - your behavior will change.

    Let's illustrate to facilitate:

    About HTTP Requests

    Every time we access something via browser (browser), several requisitions are triggered. When you access any page, a request for the content of that page is created. When this content returns, browser mounts (render) the page, but this page requires other features such as images, fonts, style sheets (css). For each feature, the browser will make a new request.

    These requests are composed mainly of three information:

    • URL: Address that will receive the request;
    • Verb/Method: Command that is desired to be made;
    • Body: Information we send, such as data from a form, for example.

    As many as the Verbs, there are 4 that are the most used:

    • GET: Used to bring information
    • POST: To create/add information
    • PUT: To store information
    • DELETE: To delete information ### RESTful Service

    They are services that have REST behavior. That is, using the same design, your behavior will change according to the way it is consumed

    For example, we have the URL (endpoint) below:

    http://www.contoso.com/students

    If we want to bring the list of students, just make a request GET:

    Request:  
    [GET] http://www.contoso.com/students  
    Body: empty  
    

    The answer will be something like:

    Response:  
    HTTP Code 200 OK  
    [  
        { id: 1, name: "Thiago Lunardi" },  
        { id: 2, name: "Joe Satriani"}  
    ]  
    

    But if I want to add a new student, I use the same design, but consuming otherwise, with POST request:

    Request:  
    [POST] http://www.contoso.com/students  
    Body: { "name: "Slash" }  
    
    HTTP Code 201 Created  
    { id: 3, name: "Slash" }  
    

    Continuing, to learn more about a student:

    Request:  
    [GET] http://www.contoso.com/students/1  
    Body: empty  
    
    Response:  
    HTTP Code 200 OK  
    {  
        id: 1,  
        name: "Thiago Lunardi",  
        github: "https://github.com/ThiagoLunardi",  
        website: "http://thiagolunardi.net",  
        blog: "https://medium.com/@thiagolunardi",  
    }  
    

    To update one-year information, in the same way, we use the same design, and we just change the way we consume the resource, now using PUT, and it will behave differently:

    Request:  
    [PUT] http://www.contoso.com/alunos/1  
    Body: { "twitter": "@thiagolunardi13" }  
    
    Response:  
    HTTP Code 200 OK  
    {  
        id: 1,  
        name: "Thiago Lunardi",  
        github: "https://github.com/ThiagoLunardi",  
        website: "http://thiagolunardi.net",  
        blog: "https://medium.com/@thiagolunardi",  
        twitter: "@thiagolunardi13"  
    }  
    

    To delete, using the DELETE:

    Request:  
    [DELETE] http://www.contoso.com/alunos/1  
    Body: empty  
    
    Response:  
    HTTP Code 204 No Content  
    

    Translated from StackOverflow.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.