---
title: "Discussion on \"HTTP PUT - Response Codes Explained\" | Hashnode"
description: "Discussion on \"HTTP PUT - Response Codes Explained\". In today's software development world, APIs have become the norm of communication between any two systems. Communication between two microservices, communication between frontend and backend of an application, etc.\nWhen APIs are all the buzz, in the ..."
url: "https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [HTTP PUT - Response Codes Explained](https://tech-hustler.hashnode.dev/http-put-response-codes-explained?utm_source=hashnode&utm_medium=feed)

In today's software development world, APIs have become the norm of communication between any two systems. Communication between two microservices, communication between frontend and backend of an application, etc. When APIs are all the buzz, in the ...

Jul 17, 2020 · 3 min read · tech-hustler.hashnode.dev  
Read the article

-   [#apis](https://hashnode.com/tag/apis)
-   [#http](https://hashnode.com/tag/http)

## Written by

[Tech Hustler](https://hashnode.com/@tech_hustler)

@tech\_hustler · Georgia, US

  
[View profile](https://hashnode.com/@tech_hustler)

Software Engineer | Tech Blogger | Entrepreneur | FullStack ( SpringBoot + AngularJS) | DevOps

## Responses 3

Markdown supported · ⌘↵ to post

[Sébastien Portebois](https://hashnode.com/@sportebois)

[Jul 18, 2020](https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf/comment/5f12efb9a02890430440956b)

As you wrote, there’s regularly some debate. That’s why it’s also useful to have an authoritative source of truth to confirm what a server should do if we want to make it follow the standards.

And that’s where RFC 7231 (section 4.3.4) comes in to confirm what you wrote:

> If the target resource does not have a current representation and the PUT successfully creates one, then the origin server MUST inform the user agent by sending a 201 (Created) response. If the target resource does have a current representation and that representation is successfully modified in accordance with the state of the enclosed representation, then the origin server MUST send either a 200 (OK) or a 204 (No Content) response to indicate successful completion of the request.

src: [tools.ietf.org/html/rfc7231](https://tools.ietf.org/html/rfc7231#section-4.3.4)

Every time such discussion starts in a design doc review or code review, following RFC is very helpful. We need very strong reason and special edge cases to pick non standard behaviors.

[Tech Hustler](https://hashnode.com/@tech_hustler)

[Jul 18, 2020](https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf/comment/5f12efb9a02890430440956b#reply-5f13179ed038b843256010c9)

Hi Sebastien, this is super helpful and thank you so much for reading my article and taking time out to comment your suggestions.

I will keep in mind to refer authoritative sources going forward! Cheers!

[Lokendra Bohra](https://hashnode.com/@lokendra17)

[Jul 17, 2020](https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf/comment/5f11f2cb3ab8123b44ad970a)

In case of successful PUT, 201 is ought to be used right?

[Tech Hustler](https://hashnode.com/@tech_hustler)

[Jul 17, 2020](https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf/comment/5f11f2cb3ab8123b44ad970a#reply-5f122793b8ea603b4afa16cb)

Hey, thank you for pointing that out!

Yes, you are right!

200 - when a resource is successfully updated and sends a response. 201 - when a resource is successfully created. (This can be done by POST also) 204 - when a resource is successfully updated but sends no response

I will update the blog accordingly!

[Tech Hustler](https://hashnode.com/@tech_hustler)

[Jul 17, 2020](https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf/comment/5f11f2cb3ab8123b44ad970a#reply-5f1235a0b8ea603b4afa16eb)

[Lokendra Bohra](https://hashnode.com/@lokendra17) Updated the post. Thanks for reading the article and taking time out to post a comment. Cheers!

[Victoria Lo](https://hashnode.com/@victoria)

[Jul 17, 2020](https://hashnode.com/posts/http-put-response-codes-explained/5f1134f78d953029bfb66dbf/comment/5f11a03a0736cb35b291fd20)

Congrats on your first article! Looking forward to more! :)
