Package com.google.appengine.api.urlfetch

Examples of com.google.appengine.api.urlfetch.FetchOptions


  }

  private HttpResponse fetch(String url, HttpRequestOptions requestOptions,
      HTTPMethod method, String content) throws IOException {

    final FetchOptions options = getFetchOptions(requestOptions);

    String currentUrl = url;

    for (int i = 0; i <= requestOptions.getMaxRedirects(); i++) {
View Full Code Here


  }

  private HttpResponse fetch(String url, HttpRequestOptions requestOptions,
      HTTPMethod method, String content) throws IOException {

    final FetchOptions options = getFetchOptions(requestOptions);

    String currentUrl = url;

    for (int i = 0; i <= requestOptions.getMaxRedirects(); i++) {
View Full Code Here

    return new PostResponse(resp.getResponseCode(), response.getBodyAsString());
  }

  @Override
  List<Cookie> getAppEngineLoginCookies(String urlStr) throws IOException {
    FetchOptions fetchOptions = FetchOptions.Builder.doNotFollowRedirects();
    URL url = new URL(urlStr);
    HTTPRequest req = new HTTPRequest(url, HTTPMethod.GET, fetchOptions);
    HTTPResponse resp = fetchService.fetch(req);
    if (resp.getResponseCode() != 302) {
      throw new LoginException("unexpected response from app engine: " + resp.getResponseCode());
View Full Code Here

        PrintWriter out = resp.getWriter();

        try {
            URL url = new URL("http://ae-book.appspot.com/blog/atom.xml");

            FetchOptions options = FetchOptions.Builder
                .doNotFollowRedirects()
                .disallowTruncate();
            HTTPRequest request = new HTTPRequest(url, HTTPMethod.GET, options);

            URLFetchService service = URLFetchServiceFactory.getURLFetchService();
View Full Code Here

        PrintWriter out = resp.getWriter();

        try {
            URL url = new URL("http://ae-book.appspot.com/blog/atom.xml/");

            FetchOptions options = FetchOptions.Builder
                .doNotFollowRedirects()
                .disallowTruncate();
            HTTPRequest request = new HTTPRequest(url, HTTPMethod.GET, options);

            URLFetchService service = URLFetchServiceFactory.getURLFetchService();
View Full Code Here

         url = request.getEndpoint().toURL();
      } catch (MalformedURLException e) {
         Throwables.propagate(e);
      }

      FetchOptions options = disallowTruncate();
      options.doNotFollowRedirects();
      if (utils.relaxHostname() || utils.trustAllCerts())
         options.doNotFollowRedirects();
      options.setDeadline(10.0);

      HTTPRequest gaeRequest = new HTTPRequest(url, HTTPMethod.valueOf(request.getMethod().toString()), options);

      for (Entry<String, String> entry : request.getHeaders().entries()) {
         String header = entry.getKey();
View Full Code Here

  }

  private HttpResponse fetch(String url, HttpRequestOptions requestOptions,
      HTTPMethod method, String content) throws IOException {

    final FetchOptions options = getFetchOptions(requestOptions);

    String currentUrl = url;

    for (int i = 0; i <= requestOptions.getMaxRedirects(); i++) {
View Full Code Here

      httpMethod = HTTPMethod.POST;
    } else {
      httpMethod = HTTPMethod.PUT;
    }
    // fetch options
    FetchOptions fetchOptions =
        FetchOptions.Builder.doNotFollowRedirects().disallowTruncate().validateCertificate();
    switch (certificateValidationBehavior) {
      case VALIDATE:
        fetchOptions.validateCertificate();
        break;
      case DO_NOT_VALIDATE:
        fetchOptions.doNotValidateCertificate();
        break;
      default:
        break;
    }
    return new UrlFetchRequest(fetchOptions, httpMethod, url);
View Full Code Here

    return responseBody;
  }

  private FetchOptions getFetchOptions() {
    FetchOptions options = FetchOptions.Builder.disallowTruncate().doNotFollowRedirects();
    return options;
  }
View Full Code Here

      log.info("Request completed");
      return ret;
    }

    private FetchOptions getFetchOptions() {
      FetchOptions options = FetchOptions.Builder
        .disallowTruncate()
        .doNotFollowRedirects();
      return options;
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.urlfetch.FetchOptions

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.