@Override
 public SuccessfulUploadResponse imageUrlUpload(ImageUrlUploadRequest imageUrlUploadRequest) {
   final WebTarget webTarget = jerseyClient.target(imageUrl);
   final Response response =
       webTarget
           .request(MediaType.APPLICATION_JSON_TYPE)
           .post(Entity.entity(wrapAuth(imageUrlUploadRequest), MediaType.APPLICATION_JSON_TYPE));
   return handleResponse(response);
 }
  private Response handleRequest(AbstractUploadRequest abstractUploadRequest, BodyPart bodyPart) {
    final WebTarget webTarget = jerseyClient.target(directUploadUrl);

    final MultiPart multiPart = new MultiPart();
    multiPart.setMediaType(MediaType.MULTIPART_FORM_DATA_TYPE);

    multiPart.bodyPart(bodyPart);
    multiPart.bodyPart(
        new FormDataBodyPart(
            DATA_PART, wrapAuth(abstractUploadRequest), MediaType.APPLICATION_JSON_TYPE));

    return webTarget
        .request(MediaType.APPLICATION_JSON_TYPE)
        .post(Entity.entity(multiPart, multiPart.getMediaType()));
  }