官术网_书友最值得收藏!

  • Mastering ASP.NET Web API
  • Mithun Pattankar Malendra Hurbuns
  • 171字
  • 2021-07-02 20:52:25

HTTP PUT example

We can perform an update to our representation with the following URL. Take note of the HTTP verb PUT.

The documentation has said that we can call a PUT method at the following resource and also note the /star as part of the URI. PUT is used to modify our representation. Generally, PUT will have a body. In the gist API for GitHub, they have made it simpler. Generally, the notion is for PUT to look similar to POST, except that the URI contains the identifier that was received when the POST method was called:

PUT behaves similar to POST when a resource does not exist. In our example from POST, if you had to call PUT the very first time with the POST request to create a contact instead, then you would receive 201, informing you that the resource was created. Then, if you had to call the request on PUT again, you will get back 200 with the same data. In this way, PUT is idempotent.

主站蜘蛛池模板: 扬州市| 汕尾市| 屯昌县| 庄浪县| 神农架林区| 滨海县| 通州市| 铜川市| 阜康市| 兴义市| 阿克陶县| 阿瓦提县| 湘潭县| 改则县| 威信县| 乌兰县| 垫江县| 长治市| 文成县| 苏州市| 屏山县| 甘肃省| 平果县| 原平市| 始兴县| 陵水| 明水县| 祥云县| 石城县| 普安县| 将乐县| 瓮安县| 大港区| 永吉县| 冷水江市| 中阳县| 资讯 | 武夷山市| 浦江县| 韶山市| 象州县|