[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -573,7 +573,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;
}
@ -732,7 +732,7 @@ public class ApiClient {
}
}
Entity<?> entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType);
Entity<?> entity = serialize(body, formParams, contentType);
Response response = null;

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;

View File

@ -563,7 +563,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;

View File

@ -563,7 +563,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;