Package com.google.api.client.http

Examples of com.google.api.client.http.HttpMethod


    request.setInterceptor(this);
  }

  public void intercept(HttpRequest request) {
    if (overrideThisMethod(request)) {
      HttpMethod method = request.getMethod();
      request.setMethod(HttpMethod.POST);
      request.getHeaders().set("X-HTTP-Method-Override", method.name());
      // Google servers will fail to process a POST unless the Content-Length header is specified
      if (request.getContent() == null) {
        request.setContent(new EmptyContent());
      }
    }
View Full Code Here


      }
    }
  }

  private boolean overrideThisMethod(HttpRequest request) {
    HttpMethod method = request.getMethod();
    if (method != HttpMethod.GET && method != HttpMethod.POST && override.contains(method)) {
      return true;
    }
    switch (method) {
      case PATCH:
View Full Code Here

TOP

Related Classes of com.google.api.client.http.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.