Skip to content

Commit

Permalink
send empty object in body for requests other than GET (#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP authored Mar 21, 2019
1 parent 7bff3d5 commit 917e10c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-Paginator-cdfd161d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Paginator",
"description": "still send '{}' in body for requests other than GET"
}
2 changes: 1 addition & 1 deletion lib/protocol/rest_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function populateBody(req) {
}
} else {
var body = builder.build(req.params, input);
if (body !== '{}') { //don't send empty object
if (body !== '{}' || req.httpRequest.method !== 'GET') { //don't send empty body for GET method
req.httpRequest.body = body;
}
applyContentTypeHeader(req);
Expand Down
22 changes: 20 additions & 2 deletions test/protocol/rest_json.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 917e10c

Please sign in to comment.