Can I PUT without an ID?

前端 未结 3 1304
难免孤独
难免孤独 2020-12-11 04:48

I\'m designing an API Rest service that allows the user to upload a file to the server.

I\'m thinking this is a PUT request and it would go to server/resource/ID and

3条回答
  •  無奈伤痛
    2020-12-11 05:15

    No. PUT means "create or update", and should come with an explicit ID. POST is suitable for creating something new.

    See also: PUT vs POST in REST

提交回复
热议问题