Skip to content

Commit 9164650

Browse files
committed
Improve wording of UPGRADING.md DELETE status code changes
1 parent a758d45 commit 9164650

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

UPGRADING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Upgrading Grape
55

66
#### DELETE now defaults to status code 200 for responses with a body, or 204 otherwise
77

8-
DELETE responses now use a 200 status code by default when a body is present, or 204 otherwise.
8+
Prior to this version, DELETE requests defaulted to a status code of 204 No Content, even when the response included content. This behavior confused some clients and prevented the formatter middleware from running properly. As of this version, DELETE requests will only default to a 204 No Content status code if no response body is provided, and will default to 200 OK otherwise.
9+
10+
Specifically, DELETE behaviour has changed as follows:
911

1012
- In versions < 0.19.0, all DELETE requests defaulted to a 200 OK status code.
1113
- In version 0.19.0, all DELETE requests defaulted to a 204 No Content status code, even when content was included in the response.
@@ -20,7 +22,7 @@ delete :id do
2022
end
2123
```
2224

23-
One can also use the new `return_no_content` helper to explicitly return 204 and an empty body for any request type:
25+
One can also use the new `return_no_content` helper to explicitly return a 204 status code and an empty body for any request type:
2426

2527
```ruby
2628
delete :id do

0 commit comments

Comments
 (0)