Package com.google.greaze.definition

Examples of com.google.greaze.definition.HttpMethod


    this.gson = gson;
  }

  public void send(HttpURLConnection conn, WebServiceRequest request) {
    try {
      HttpMethod method = request.getHttpMethod();
      if (SIMULATE_POST_WITH_PUT && method == HttpMethod.PUT) {
        method = HttpMethod.POST;
        setHeader(conn, HttpMethod.SIMULATED_METHOD_HEADER, HttpMethod.PUT.toString(), true);
      }
      if (LogConfig.INFO) logger.info(method + " to " + conn.getURL());
      conn.setRequestMethod(method.toString());
      // Assume conservatively that the response will need to be read.
      // This is done here instead of in the response receiver because this property must be set
      // before sending any data on the connection.
      conn.setDoInput(true);
      setHeader(conn, "Accept", request.getContentType(), true);
View Full Code Here


      HttpMethod method, Map<String, String> headers,
      UrlParams urlParams, RequestBody requestBody) {
    this.inlined = inlined;
    this.spec = spec;
    this.gson = gson;
    HttpMethod simulatedMethod = getSimulatedHttpMethod(headers);
    this.method = simulatedMethod != null ? simulatedMethod : method;
    this.urlParams = urlParams;
    this.requestBody = requestBody;
    this.headers = buildRequestHeaders(headers);
  }
View Full Code Here

    this.resources = resources;
  }

  public void buildResponse(WebContext context, RestRequestBase<I, R> request,
      RestResponseBase.Builder<I, R> responseBuilder) {
    HttpMethod method = request.getMethod();
    R responseBody = null;
    switch (method) {
      case GET:
        responseBody = get(request.getId(), context);
        break;
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.HttpMethod

Copyright © 2018 www.massapicom. 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.