Package com.google.api.client.http

Examples of com.google.api.client.http.HttpHeaders$HeaderParsingFakeLevelHttpRequest


   * @return the report HTTP URL connection
   * @throws AuthenticationException If OAuth authorization fails.
   */
  @VisibleForTesting
  HttpRequestFactory getHttpRequestFactory(final String reportUrl) throws AuthenticationException {
    final HttpHeaders httpHeaders = createHeaders(reportUrl);
    return httpTransport.createRequestFactory(new HttpRequestInitializer() {

      public void initialize(HttpRequest request) throws IOException {
        request.setHeaders(httpHeaders);
        request.setConnectTimeout(reportDownloadTimeout);
View Full Code Here


   * Creates the http headers object for this request, populated from data in
   * the session.
   * @throws AuthenticationException If OAuth authorization fails.
   */
  private HttpHeaders createHeaders(String reportUrl) throws AuthenticationException {
    HttpHeaders httpHeaders = new HttpHeaders();
    httpHeaders.setAuthorization(
        authorizationHeaderProvider.getAuthorizationHeader(session, reportUrl));
    httpHeaders.setUserAgent(userAgentCombiner.getUserAgent(session.getUserAgent()));
    httpHeaders.set("developerToken", session.getDeveloperToken());
    httpHeaders.set("clientCustomerId", session.getClientCustomerId());
    httpHeaders.set("returnMoneyInMicros", Boolean.toString(
        session.isReportMoneyInMicros()));
    return httpHeaders;
  }
View Full Code Here

            request = f.buildPostRequest(url, null);
        else
          request = f.buildPostRequest(url, new UrlEncodedContent(postData));
      else
        request = f.buildGetRequest(url);
      HttpHeaders headers = new HttpHeaders();
      headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
      request.setHeaders(headers);
      if (debug) {
          Logger logger = Logger.getLogger(HttpTransport.class.getName());
          logger.removeHandler(debugHandler);
          logger.setLevel(Level.ALL);
View Full Code Here

    if (readTimeout != -1)
      request.setReadTimeout(readTimeout);
    if (connectionTimeout != -1)
      request.setConnectTimeout(connectionTimeout);

    HttpHeaders headers = new HttpHeaders();
    headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
    headers.set("Host", host);
    request.setHeaders(headers);
    return request;
  }
View Full Code Here

    if (readTimeout != -1)
      request.setReadTimeout(readTimeout);
    if (connectionTimeout != -1)
      request.setConnectTimeout(connectionTimeout);

    HttpHeaders headers = new HttpHeaders();
    headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
    headers.set("Host", host);

    if (headerProvider != null) {
      Map<String, Object> info = headerProvider.getHeaders();
      for (String key : info.keySet()) {
        headers.set(key, info.get(key));
      }
    }

    request.setHeaders(headers);
    return request;
View Full Code Here

          request = f.buildPostRequest(url, null);
        else
          request = f.buildPostRequest(url, new UrlEncodedContent(postData));
      else
        request = f.buildGetRequest(url);
      HttpHeaders headers = new HttpHeaders();
      headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
      headers.set("Host", host);
      request.setHeaders(headers);

      // get the response
      br = new BufferedReader(new InputStreamReader(request.execute()
          .getContent()));
View Full Code Here

          request = f.buildPostRequest(url, null);
        else
          request = f.buildPostRequest(url, new UrlEncodedContent(postData));
      else
        request = f.buildGetRequest(url);
      HttpHeaders headers = new HttpHeaders();
      headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
      headers.set("Host", host);

      if (headerProvider != null) {
        Map<String, Object> info = headerProvider.getHeaders();
        for (String key : info.keySet()) {
          headers.set(key, info.get(key));
        }
      }

      request.setHeaders(headers);
View Full Code Here

    return request.execute().parseAs(type);
  }

  private void setUpCommonHeaders(HttpRequest request) {
    HttpHeaders httpHeaders = new HttpHeaders();
    httpHeaders.setAccept(acceptType);
    httpHeaders.setContentType(contentType);

    request.setHeaders(httpHeaders);
  }
View Full Code Here

    if (readTimeout != -1)
      request.setReadTimeout(readTimeout);
    if (connectionTimeout != -1)
      request.setConnectTimeout(connectionTimeout);

    HttpHeaders headers = new HttpHeaders();
    headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
    headers.set("Host", host);
    request.setHeaders(headers);
    return request;
  }
View Full Code Here

      if (readTimeout != -1)
        request.setReadTimeout(readTimeout);
      if (connectionTimeout != -1)
        request.setConnectTimeout(connectionTimeout);

      HttpHeaders headers = new HttpHeaders();
      headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
      headers.set("Host", host);

      if (headerProvider != null) {
        Map<String, Object> info = headerProvider.getHeaders();
        for (String key : info.keySet()) {
          headers.set(key, info.get(key));
        }
      }

      request.setHeaders(headers);
View Full Code Here

TOP

Related Classes of com.google.api.client.http.HttpHeaders$HeaderParsingFakeLevelHttpRequest

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.