[Java][OkHTTP] fix empty request body handling (#12172)

This commit is contained in:
Oleh Kurpiak
2022-04-19 19:17:28 +03:00
committed by GitHub
parent 5f1f47d156
commit 12454de3ac
5 changed files with 5 additions and 5 deletions

View File

@@ -1229,7 +1229,7 @@ public class ApiClient {
reqBody = null;
} else {
// use an empty request body (for POST, PUT and PATCH)
reqBody = RequestBody.create("", MediaType.parse(contentType));
reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType));
}
} else {
reqBody = serialize(body, contentType);