HTTP 201 Created indicates that the request was fulfilled and a new resource was created as a result. The Location header typically contains the URI of the newly created resource. This is the expected response for successful POST requests that create new entities.
201 CreatedPOST /blog/posts/42/comments HTTP/1.1
Host: www.example.com
User-Agent: curl/8.6.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 58
name=Alice&comment=Great+post%2C+really+helpful+thank+you%21HTTP/1.1 201 Created
Location: /blog/posts/42#comment-187
Content-Type: text/html; charset=utf-8
Content-Length: 389
<!doctype html>
<html lang="en">
<head>
<title>Comment posted - Example Blog</title>
</head>
<body>
<h1>Thanks, Alice!</h1>
<p>Your comment has been posted.</p>
<a href="/blog/posts/42">Back to post</a>
</body>
</html>The response should include a Location header pointing to the newly created resource.
curl -v -X POST -d '{"name":"test"}' -H 'Content-Type: application/json' https://api.example.com/itemsSend a GET request to the Location URI to confirm the resource was created correctly.
If repeated POST requests create duplicate resources, the API may need idempotency keys.
An API endpoint received a valid POST request and created a new record, returning its location.
A file was successfully uploaded and stored on the server.
| Specification | Section |
|---|---|
| HTTP Semantics | RFC 9110 §15.3.2 |
This reference was compiled from official RFCs, protocol specifications, and hands-on troubleshooting experience. AI tools were used primarily for formatting and organizing the content on the page.