When i invoke next code:
Response response = target.request(MediaType.APPLICATION_JSON_TYPE)
.post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE));
response.getEntity();
response.getEntity() is always null.
But when i invoke:
JsonObject json = target.request(MediaType.APPLICATION_JSON_TYPE)
.post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), JsonObject.class);
variable json is not null.
I need to use first variant because i need to check response status.
Why the first code is not working?And how can i get status code then?