PUT is idempotent which means repeating the same request should not create a mess of duplicate resources unless your server is feeling dramatic and documents that behavior. The server must clearly say whether the resource was created updated or accepted for later work. No cryptic whispering allowed.
If the client created a new resource by sending a PUT then respond with 201 Created. Include a Location header that points to the new resource URL and you may also return the new representation in the response body for convenience. Clients like being handed the truth right away.
When the server updated an existing resource and wants to give the client the fresh canonical view return 200 OK with the updated representation. This is handy for clients that want an immediate snapshot for display or caching without asking twice.
If the update applied and there is nothing useful to return choose 204 No Content. This keeps traffic small and honest and saves clients from parsing empty mystery bodies.
If the update is queued for later processing return 202 Accepted and give the client a way to check progress such as a status URL provided in the Location header or in the response body. Tell them how to check back so they do not start yelling in support channels.
Consistent headers are the difference between a maintainable API and heroic guesswork by client developers. Always set an ETag when you support optimistic concurrency control and expect clients to use If Match headers when they try to update a known version. Use Content Location when the representation you return comes from a different URL than the request target.
In short do not be coy. Decide whether PUT will return a representation or just a thumbs up and document the choice. Your future self and your users will thank you and your support inbox will be slightly less dramatic.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.