0

I'm creating an endpoint that looks something like

POST '../v1/container/{container-id}/items/bulk-create'

This endpoint should get a list of items data and create them under that container. It's done syncly, i.e all items should be created before the user gets the response (as opposed to async job), and all items should be created or failed (no part creation). I wonder what should be the response of success - should it be 200 or 201?

1 Answer 1

0

Today, the registered reference for HTTP POST is RFC-ietf-httpbis-semantics

If one or more resources has been created on the origin server as a result of successfully processing a POST request, the origin server SHOULD send a 201 (Created) response containing a Location header field that provides an identifier for the primary resource created (Section 10.2.2) and a representation that describes the status of the request while referring to the new resource(s).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.