What exactly does REST mean? What is it, and why is it getting big now?

后端 未结 5 857
Happy的楠姐
Happy的楠姐 2020-12-07 09:07

I understand (I think) the basic idea behind RESTful-ness. Use HTTP methods semantically - GET gets, PUT puts, DELETE deletes, etc... Right? thought I understood

5条回答
  •  心在旅途
    2020-12-07 09:51

    This is what REST might look like:

    POST /user
    fname=John&lname=Doe&age=25
    

    The server responds:

    201 Created
    Location: /user/123
    

    In the future, you can then retrieve the user information:

    GET /user/123
    

    The server responds (assuming an XML response):

    200 OK
    JohnDoe25
    

    To update:

    PUT /user/123
    fname=Johnny
    

提交回复
热议问题