What is the difference between SOAP and REST webservices? Can SOAP be RESTful?

前端 未结 4 1981
迷失自我
迷失自我 2020-12-30 06:48

From MSDN magazine https://msdn.microsoft.com/en-us/magazine/dd315413.aspx and https://msdn.microsoft.com/en-us/magazine/dd942839.aspx I understand that

When RESTful

4条回答
  •  [愿得一人]
    2020-12-30 07:32

    REST uses the HTTP verbs to articulate what action you are trying to accomplish.

    A "GET" request is asking the service to return the item at a location.

    A "POST" request is asking the service to create a new entity at a location (which will probably get persisted to a DB behind the scenes).

    A "PUT" request is asking the service to update an existing entity at a location.

    A "DELETE" request is asking the service to remove an existing entity at a location.

    So no, you can't really use "POST" for something like a "GET" and still call yourself a REST API. Your consumers will be really confused by that.

提交回复
热议问题