Consequences of POST not being idempotent (RESTful API)

前端 未结 6 1486
傲寒
傲寒 2021-01-30 09:13

I am wondering if my current approach makes sense or if there is a better way to do it.

I have multiple situations where i want to create new objects and let the server

6条回答
  •  面向向阳花
    2021-01-30 09:34

    I think you could also collapse creation and update request into only one request (upsert). In order to create a new resource, client POST a “factory” resource, located for example at /factory-url-name. And then the server returns the URI for the new resource.

提交回复
热议问题