BloggingBIG Logo
Search
  • Blogs
  • How we work
  • Write Guest Post
Get started

HTTP Status Code – 201 Created

by Kedar Dangal

  • 3 min read
    • HTTP Status
Share this content
HTTP Status Code – 201 Created image

Navigation

  • What does status code 201 created means? 
  • Status
  • HTTP Headers
  • Lost Update Problem
  • 201 Code References
  • Browser compatibility
  • FAQs
    • What is a 201 code?
    • What is the difference between 200 and 201 status code?
    • How do I return my 201 status code?
  • Conclusion

What does status code 201 created means? 

The 2xx (Successful) class of status code indicates that the client’s request was successfully received, understood, and accepted.

The HTTP Status Code 201 created means that the request has been fulfilled successfully and has resulted in one or more new resources being created.

The primary resource created by the request is identified by either a Location header field in the response or, if no Location field is received, by the effective request URI.

Status

201 Created

HTTP Headers

The response might include a URI in the Location header field of the HTTP headers list that refers to the newly created resource. In addition, the response payload may contain an object that has a list of resource attributes and location(s) from which the user or user agent can select the most appropriate. The media type supplied in the Content-Type header field specifies the entity format.

Lost Update Problem

The ETag response header field in the HTTP 201 response may include the current value of the entity tag for the requested variation that was just created. To avoid the “lost update” problem, the ETag header information can be utilized in later conditional requests.

When many persons modify a resource without being aware of each other’s modifications, a lost update problem occurs. The last individual to change a resource “wins” in this circumstance, and prior updates are lost. ETags can be used in conjunction with the If-Match header to instruct the server whether or not to update a resource. If ETag does not match, the server sends a 412 (Precondition Failed) response to the client.

201 Code References

Rails HTTP Status Symbolcreated
Go HTTP Status Constant http.StatusCreated
Symfony HTTP Status Constant Response::HTTP_CREATED
Python2 HTTP Status Constant httplib.CREATED
Python3+ HTTP Status Constant http.client.CREATED
Python3.5+ HTTP Status Constant http.HTTPStatus.CREATED

Browser compatibility

browser compatibility - 201 created
Credit:mozilla.org
Full Support

FAQs

What is a 201 code?

The HTTP Status Code 201 created means that the request has been fulfilled successfully and has resulted in one or more new resources being created.

What is the difference between 200 and 201 status code?

Both simply mean successful. By far the most common status code returned is 200. Simply said, it implies that the request was received, understood, and is now being processed. A 201 status code indicates that a request was successful and that a resource (for example, a new page) was generated as a result.

How do I return my 201 status code?

The request has been fulfilled and has resulted in one or more new resources being created. The primary resource created by the request is identified by either a Location header field in the response or, if no Location field is received, by the effective request URI.

Related Post:

HTTP Status Code 300-Multiple Choices

HTTP Status Code 302 Found

HTTP Status Code 204 – No Content

HTTP Status Code 203 – Non-authoritative Information

HTTP Status Code 207 Multi-Status

HTTP Status Code 208 Already Reported

HTTP Status Code 400 Bad Request

HTTP Status Code 401 Unauthorized

HTTP Status Code 403 Forbidden Error

HTTP Status Code 404 Not Found

HTTP Status Code 405 Method Not Allowed

HTTP Status Code 409 Conflict

HTTP Status Code 411 Length Required

Conclusion

I hope this article was able to help you with your doubts and queries related to HTTP status code 201 created. Still, if there are any questions you have that are unanswered, feel free to ask them in the comment section, we would be happy to assist you. Thank you.

Reference: 201 created


Share
Tweet
Share
0 Shares
Kedar Dangal image

Kedar Dangal

Making a difference, Adding the sum.

Be first to comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

More from HTTP Status

HTTP Status Code 499 Client Closed Request image

HTTP Status Code 499 Client Closed Request

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 431 Request Header Fields Too Large image

HTTP Status Code 431 Request Header Fields Too Large

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 429-Too Many Request image

HTTP Status Code 429-Too Many Request

Saurabh Chalise image

by Saurabh Chalise

  • 4 min read
    • HTTP Status

Quick links

  • Siteground black friday deals
  • Wp engine black friday deals
  • Greengeeks black friday deals
  • Tmd hosting black friday deals
  • Fastcomet black friday deals
  • Hostwinds black friday deals
  • bluehost black friday
  • Namecheap black friday deals
  • Ionos 1 & 1 black friday deals
  • Hostgator black friday deals
  • ipage black friday deals
  • wpx hosting black friday deals
BloggingBIG logo
  • About
  • DISCLAIMER
  • Disclouser for Blogging BIG
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
Developed by Fnclick
Back To Top