Skip to content

Commit 7e1724b

Browse files
committed
Merge pull request #23 from auth0/bugfix-useable-GET-method
Do not add request body if there's nothing to add
2 parents 7b6471c + 6d1f451 commit 7e1724b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

auth0/src/main/java/com/auth0/request/internal/BaseRequest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ protected ObjectReader getReader() {
9898
}
9999

100100
protected RequestBody buildBody() throws RequestBodyBuildException {
101-
return JsonRequestBodyBuilder.createBody(builder.asDictionary(), writer);
101+
Map<String, Object> dictionary = builder.asDictionary();
102+
if (!dictionary.isEmpty()) {
103+
return JsonRequestBodyBuilder.createBody(dictionary, writer);
104+
}
105+
return null;
102106
}
103107

104108
protected APIException parseUnsuccessfulResponse(Response response) {

0 commit comments

Comments
 (0)