News for hackers. Stuff that matters.
Re:Curl is just the hobby by plextoria on Monday April 22, 2024 @06:23AM (#40112941)
PUT can be used for Create too, if the user ID is generated by the client
Re:Curl is just the hobby by ascar on Monday April 22, 2024 @07:38AM (#40113338)
According to the RFC's PUT can be used to create a resource as long as the request has a clear target. That doesn't necessarily mean an ID, but just some kind of identifier (composite key, hash of content, url, etc.). When a create instead of update happens the server should respond with a 201 CREATED, which should indicate the location or identifier of the created resource.