Package com.sun.jersey.api.client.WebResource

Examples of com.sun.jersey.api.client.WebResource.Builder.type()


            }
          }
          response = builder.type(contentType).put(ClientResponse.class, formParamBuilder.toString());
        }
        else
          response = builder.type(contentType).put(ClientResponse.class, serialize(body));
      }
    }
    else if ("DELETE".equals(method)) {
      if(body == null)
        response = builder.delete(ClientResponse.class, serialize(body));
View Full Code Here


    }
    else if ("DELETE".equals(method)) {
      if(body == null)
        response = builder.delete(ClientResponse.class, serialize(body));
      else
        response = builder.type(contentType).delete(ClientResponse.class, serialize(body));
    }
    else {
      throw new ApiException(500, "unknown method type " + method);
    }
    if(response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) {
View Full Code Here

    }
    else if ("POST".equals(method)) {
      if(body == null)
        response = builder.post(ClientResponse.class, serialize(body));
      else
        response = builder.type(contentType).post(ClientResponse.class, serialize(body));
    }
    else if ("PUT".equals(method)) {
      if(body == null)
        response = builder.put(ClientResponse.class, serialize(body));
      else {
View Full Code Here

              catch (Exception e) {
                // move on to next
              }
            }
          }
          response = builder.type(contentType).put(ClientResponse.class, formParamBuilder.toString());
        }
        else
          response = builder.type(contentType).put(ClientResponse.class, serialize(body));
      }
    }
View Full Code Here

            }
          }
          response = builder.type(contentType).put(ClientResponse.class, formParamBuilder.toString());
        }
        else
          response = builder.type(contentType).put(ClientResponse.class, serialize(body));
      }
    }
    else if ("DELETE".equals(method)) {
      if(body == null)
        response = builder.delete(ClientResponse.class, serialize(body));
View Full Code Here

    }
    else if ("DELETE".equals(method)) {
      if(body == null)
        response = builder.delete(ClientResponse.class, serialize(body));
      else
        response = builder.type(contentType).delete(ClientResponse.class, serialize(body));
    }
    else {
      throw new ApiException(500, "unknown method type " + method);
    }
    if(response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) {
View Full Code Here

    public void sendMessage(String path, BrokeredMessage message) {
        Builder request = getResource().path(path).path("messages")
                .getRequestBuilder();

        if (message.getContentType() != null) {
            request = request.type(message.getContentType());
        }

        if (message.getBrokerProperties() != null) {
            request = request.header("BrokerProperties",
                    mapper.toString(message.getBrokerProperties()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.