I try to send an http post request with postman and it works
(it works using curl
as well)
I get a positive response
I try to do the same request in code using
import javax.ws.rs.client.WebTarget;
Map<String, String> formData = new HashMap();
formData.put("update_type", "config");
formData.put("role", role);
formData.put("name", configNameCamelCase);
formData.put("version", version);
formData.put("work_env", env);
formData.put("project", "waze-prod");
formData.put("provider", "gce");
try {
String a = commonClient.webTarget
.path("/tasks/update_version")
.request()
.header("Authorization", commonClient.authorizedRequestBuilder())
.accept(MediaType.APPLICATION_FORM_URLENCODED_TYPE)
.post(Entity.entity(formData, MediaType.APPLICATION_JSON))
.readEntity(String.class);
}
How should i change my code to make it identical to the postman request