TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Consistent and Beautiful RESTful API Design Tips from Experience

3 pointsby turingbookalmost 8 years ago

1 comment

half0wlalmost 8 years ago
Great article. I&#x27;d like to add that while `PUT` can be used for updating data, you should only ever use this if you are updating the entire object. It&#x27;s more &quot;replacing&quot; the object with new values than updating it - i.e. what you `PUT` to the endpoint is the new object. Therefore, if you don&#x27;t provide the entire object in the request, you can lose data.<p>In most cases, even when updating entire objects, I prefer `PATCH` because of this - by design, it only overwrites what you specify.