.get(Response.class);
return RestResponse.getRestResponse(resp);
}
public static RestResponse post(String address, Object payload, String contentType) {
WebTarget target = getJerseyClient().target(address);
if (contentType == null) {
contentType = MediaType.APPLICATION_JSON;
}
if (payload instanceof Map) {
payload = buildMultivalueMap((Map<String, Object>) payload);
}
Response cr = target.request(RESPONSE_TYPE).header("Content-Type", contentType)
.cookie(new Cookie(REST_TOKEN_COOKIE, getRestToken()))
// .header("Content-type", MediaType.APPLICATION_FORM_URLENCODED)
.post(Entity.entity(payload, contentType), Response.class);
RestResponse rr = RestResponse.getRestResponse(cr);
return rr;