Examples of buildPostRequest()


Examples of com.google.api.client.http.HttpRequestFactory.buildPostRequest()

      HttpRequest request = null;
      if ("POST".equals(requestMethod))
        if (postData == null)
            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);
View Full Code Here

Examples of com.google.api.client.http.HttpRequestFactory.buildPostRequest()

      throws ReportException {
    try {
      String downloadUrl = generateReportUrl(version);
      HttpRequestFactory requestFactory =
          reportRequestFactoryHelper.getHttpRequestFactory(downloadUrl);
      HttpRequest httpRequest = requestFactory
          .buildPostRequest(new GenericUrl(downloadUrl), reportBodyProvider.getHttpContent());
      HttpResponse response = httpRequest.execute();
      return new RawReportDownloadResponse(response.getStatusCode(), response.getContent());
    } catch (MalformedURLException e) {
      throw new ReportException("Created invalid report download URL.", e);
View Full Code Here

Examples of com.google.api.client.http.HttpRequestFactory.buildPostRequest()

        f = transport.createRequestFactory();
      }
      HttpRequest request = null;
      if ("POST".equals(requestMethod))
        if (postData == null)
            request = f.buildPostRequest(url, null);
        else
          request = f.buildPostRequest(url, new UrlEncodedContent(postData));
      else
        request = f.buildGetRequest(url);
      HttpHeaders headers = new HttpHeaders();
View Full Code Here

Examples of com.google.api.client.http.HttpRequestFactory.buildPostRequest()

      HttpRequest request = null;
      if ("POST".equals(requestMethod))
        if (postData == null)
            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);
View Full Code Here

Examples of com.google.api.client.http.HttpRequestFactory.buildPostRequest()

      f = transport.createRequestFactory();
    }
    HttpRequest request = null;
    if ("POST".equals(requestMethod))
      if (postData == null)
        request = f.buildPostRequest(url, null);
      else
        request = f.buildPostRequest(url, new UrlEncodedContent(postData));
    else
      request = f.buildGetRequest(url);
View Full Code Here

Examples of com.google.api.client.http.HttpTransport.buildPostRequest()

        JsonHttpParser parser = new JsonHttpParser();
        parser.jsonFactory = new JacksonFactory();
        transport.addParser(parser);

        // build the HTTP POST request and URL
        HttpRequest request = transport.buildPostRequest();
        request.setUrl(GOOGL_URL);
        GenericData data = new GenericData();
        data.put("longUrl", url);
      
        JsonHttpContent content = new JsonHttpContent();
View Full Code Here

Examples of com.google.api.client.http.javanet.NetHttpTransport.buildPostRequest()

        JsonHttpParser parser = new JsonHttpParser();
        parser.jsonFactory = new JacksonFactory();
        transport.addParser(parser);

        // build the HTTP POST request and URL
        HttpRequest request = transport.buildPostRequest();
        request.setUrl(GOOGL_URL);
        GenericData data = new GenericData();
        data.put("longUrl", url);
      
        JsonHttpContent content = new JsonHttpContent();
View Full Code Here

Examples of org.apache.sling.testing.tools.http.RequestBuilder.buildPostRequest()

        final MultipartEntity entity = new MultipartEntity();
        // Add Sling POST options
        entity.addPart("lang", new StringBody("esp"));
        entity.addPart("code", new InputStreamBody(getClass().getResourceAsStream("/test.js"), "test.js"));
        executor.execute(
                rb.buildPostRequest("/system/console/scriptconsole.json")
                 .withEntity(entity)
                 .withCredentials("admin","admin")
            ).assertStatus(200);
    }
}
View Full Code Here

Examples of org.apache.sling.testing.tools.http.RequestBuilder.buildPostRequest()

            }
        }
       
        log.info("Executing test remotely, path={} JUnit servlet URL={}",
                subpath, junitServletUrl);
        final Request r = builder
        .buildPostRequest(subpath.toString())
        .withCredentials(username, password)
        .withCustomizer(requestCustomizer)
        .withEntity(new UrlEncodedFormEntity(opt));
        executor.execute(r).assertStatus(200);
View Full Code Here

Examples of org.apache.sling.testing.tools.http.RequestBuilder.buildPostRequest()

        final MultipartEntity entity = new MultipartEntity();
        // Add Sling POST options
        entity.addPart("lang", new StringBody("groovy"));
        entity.addPart("code", code);
        executor.execute(
            rb.buildPostRequest("/system/console/sc").withEntity(entity).withCredentials(
                    "admin", "admin")).assertStatus(200);
    }

    private void execute2(String code) throws Exception
    {
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.