Skip to content

Commit fa7b158

Browse files
committed
Return 200 from POST Actions
1 parent faa9220 commit fa7b158

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

azure/Guidelines.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Method | Description | Response Status Code
157157
PATCH | Create/Modify the resource with JSON Merge Patch | `200-OK`, `201-Created`
158158
PUT | Create/Replace the _whole_ resource | `200-OK`, `201-Created`
159159
POST | Create new resource (ID set by service) | `201-Created` with URL of created resource
160-
POST | Action | `200-OK`, `204-No Content` (only when nothing returned in response body)
160+
POST | Action | `200-OK`
161161
GET | Read (i.e. list) a resource collection | `200-OK`
162162
GET | Read the resource | `200-OK`
163163
DELETE | Remove the resource | `204-No Content`\; avoid `404-Not Found`
@@ -174,6 +174,9 @@ DELETE | Remove the resource | `204-No Content`\; avoid `404-Not Found`
174174
<a name="http-delete-returns-204"></a>
175175
:white_check_mark: **DO** return a `204-No Content` without a resource/body for a DELETE operation (even if the URL identifies a resource that does not exist; do not return `404-Not Found`)
176176

177+
<a name="http-post-action-returns-200"></a>
178+
:white_check_mark: **DO** return a `200-OK` from a POST Action. Include a body in the response, even if it has not properties, to allow properties to be added in the future if needed.
179+
177180
<a name="http-return-403-vs-404"></a>
178181
:white_check_mark: **DO** return a `403-Forbidden` when the user does not have access to the resource _unless_ this would leak information about the existence of the resource that should not be revealed for security/privacy reasons, in which case the response should be `404-Not Found`. [Rationale: a `403-Forbidden` is easier to debug for customers, but should not be used if even admitting the existence of things could potentially leak customer secrets.]
179182

0 commit comments

Comments
 (0)