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

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


        } else if ("POST".equals(method)) {
            builder.header("Lumify-CSRF-Token", this.csrfToken);
            if (body == null) {
                response = builder.post(ClientResponse.class, serialize(body));
            } else if (body instanceof FormDataMultiPart) {
                response = builder.type(contentType).post(ClientResponse.class, body);
            } else {
                response = builder.type(contentType).post(ClientResponse.class, serialize(body));
            }
        } else if ("PUT".equals(method)) {
            builder.header("Lumify-CSRF-Token", this.csrfToken);
View Full Code Here


            if (body == null) {
                response = builder.post(ClientResponse.class, serialize(body));
            } else if (body instanceof FormDataMultiPart) {
                response = builder.type(contentType).post(ClientResponse.class, body);
            } else {
                response = builder.type(contentType).post(ClientResponse.class, serialize(body));
            }
        } else if ("PUT".equals(method)) {
            builder.header("Lumify-CSRF-Token", this.csrfToken);
            if (body == null) {
                response = builder.put(ClientResponse.class, serialize(body));
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));
            }
        } else if ("DELETE".equals(method)) {
            builder.header("Lumify-CSRF-Token", this.csrfToken);
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)) {
            builder.header("Lumify-CSRF-Token", this.csrfToken);
            if (body == null) {
                response = builder.delete(ClientResponse.class, serialize(body));
View Full Code Here

        } else if ("DELETE".equals(method)) {
            builder.header("Lumify-CSRF-Token", this.csrfToken);
            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

              } 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
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

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

            }
          }
          response = builder.type(contentType).post(
              ClientResponse.class, formParamBuilder.toString());
        } 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));
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.