[java-jersey2] Fix empty body when form parameters supplied (#5169)

This commit is contained in:
Ben Cox
2020-02-03 09:11:59 +00:00
committed by GitHub
parent b36b65964f
commit fbcb8e0c7e
4 changed files with 8 additions and 8 deletions

View File

@@ -562,7 +562,7 @@ public class ApiClient {
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
} else {
// We let jersey handle the serialization
entity = Entity.entity(obj, contentType);
entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType);
}
return entity;
}
@@ -716,7 +716,7 @@ public class ApiClient {
}
}
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
Entity<?> entity = serialize(body, formParams, contentType);
Response response = null;