Examples of RequestOptions


Examples of com.englishtown.vertx.promises.RequestOptions

    }

    @Test
    public void testGetStream() throws Exception {

        RequestOptions options = new RequestOptions().setPauseResponse(true);

        whenHttpClient.request(HttpMethod.GET, BASE_PATH + "/stream", options)
                .then(response -> {
                    assertEquals(200, response.statusCode());
                    assertNull(response.headers().get(HttpHeaders.Names.TRANSFER_ENCODING));
View Full Code Here

Examples of com.esri.gpt.server.csw.provider.components.RequestOptions

      httpRequest.getSession().setAttribute("com.esri.gpt.user",admin);
     
      // make the CSW request handler
      rc = RequestContext.extract(httpRequest);
      handler = ProviderFactory.newHandler(rc);
      RequestOptions rOptions = handler.getOperationContext().getRequestOptions();
      rOptions.getTransactionOptions().setAutoApprove(true);
     
      // execute the testable action
      if (action.nodeName.equalsIgnoreCase("url")) {
        handler.handleGet(httpRequest);
      } else if (actionName.equalsIgnoreCase("xml")) {
View Full Code Here

Examples of com.google.gwt.gadgets.client.io.RequestOptions

    url += "?nocache=" + Math.random();
    if (userId != null) {
      url += "&userId=" + userId;
    }

    RequestOptions opts = RequestOptions.newInstance().setAuthorizationType(
        AuthorizationType.SIGNED);
    io.makeRequestAsJso(url, callback, opts);
  }
View Full Code Here

Examples of com.marklogic.xcc.RequestOptions

                + options.getProcessModule());
        uriQueue = new UriQueue(completionService, pool, tf, monitor,
                new LinkedBlockingQueue<String>(), logger);

        // must not cache the results, or we quickly run out of memory
        RequestOptions requestOptions = new RequestOptions();
        requestOptions.setCacheResult(false);

        Session session = null;
        int count = 0;
        int total = -1;
View Full Code Here

Examples of org.apache.abdera.protocol.client.RequestOptions

          "http://www.w3.org/2000/09/xmldsig#",
          "Signature")));

    // Verify the signature with Verisign's "Signed Ping" interop endpoint
    Client client = new CommonsClient();
    RequestOptions reqoptions = client.getDefaultRequestOptions();
    reqoptions.setContentType("application/xml");
    BaseRequestEntity bre = new BaseRequestEntity(entry,false);
    ClientResponse response = client.post(
      "http://verisignlabs.com/tg/verify",
      bre, reqoptions);
    assertEquals(response.getStatus(),200);
View Full Code Here

Examples of org.apache.abdera.protocol.client.RequestOptions

        URLEncoder.encode(pwd, "utf-8"),
        (service != null) ? URLEncoder.encode(service, "utf-8") : "",
        URLEncoder.encode(Version.APP_NAME, "utf-8"));
      StringRequestEntity stringreq = new StringRequestEntity(f.toString());
      String uri = "https://www.google.com/accounts/ClientLogin";
      RequestOptions options = client.getDefaultRequestOptions();
      options.setContentType("application/x-www-form-urlencoded");
      ClientResponse response = client.post(uri, stringreq, options);
      InputStream in = response.getInputStream();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      int n = -1;
      while ((n = in.read()) != -1) { out.write(n); }
View Full Code Here

Examples of org.apache.abdera.protocol.client.RequestOptions

        (service != null) ? URLEncoder.encode(service, "utf-8") : "",
        URLEncoder.encode(Version.APP_NAME, "utf-8"));
      StringRequestEntity stringreq = new StringRequestEntity(
        f.toString(),"application/x-www-form-urlencoded","utf-8");
      String uri = "https://www.google.com/accounts/ClientLogin";
      RequestOptions options = abderaClient.getDefaultRequestOptions();
      options.setContentType("application/x-www-form-urlencoded");
      ClientResponse response = abderaClient.post(uri, stringreq, options);
      InputStream in = response.getInputStream();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      int n = -1;
      while ((n = in.read()) != -1) { out.write(n); }
View Full Code Here

Examples of org.apache.abdera.protocol.client.RequestOptions

//    assertEquals(resp1, "5");
  }
 
  public void testResponseMustRevalidate() throws Exception {
    Client client = new CommonsClient();
    RequestOptions options = client.getDefaultRequestOptions();
    options.setHeader("Connection", "close");
    options.setHeader("x-reqnum", "1");
    ClientResponse response = client.get(CHECK_MUST_REVALIDATE, options);
 
    String resp1 = getResponse(response);
    assertEquals(resp1, "1");
   
    // Should be revalidated and use the cache
    options.setHeader("x-reqnum", "2");
    response = client.get(CHECK_MUST_REVALIDATE, options);
    assertTrue(response instanceof CachedResponse);
   
    String resp2 = getResponse(response);
    assertEquals(resp2, "1");
   
    // Should be revalidated and return a 404
    options.setHeader("x-reqnum", "3");
    response = client.get(CHECK_MUST_REVALIDATE, options)
    assertEquals(response.getStatus(), 404);
    response.release();

  }
View Full Code Here

Examples of org.apache.abdera.protocol.client.RequestOptions

  }
 
  private void _methodInvalidates(int type) throws Exception {
   
    Client client = new CommonsClient();
    RequestOptions options = client.getDefaultRequestOptions();
    options.setHeader("Connection", "close");
    options.setHeader("x-reqnum", "1");
    ClientResponse response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    String resp1 = getResponse(response);
    response.release();
    assertEquals(resp1, "1");
   
    // calling a method that could change state on the server should invalidate the cache
    options.setHeader("x-reqnum", "2");
    switch(type) {
      case POST: 
        response = client.post(
          CHECK_CACHE_INVALIDATE,
          new ByteArrayInputStream("".getBytes()),
          options);
        break;
      case PUT:
        response = client.put(
          CHECK_CACHE_INVALIDATE,
          new ByteArrayInputStream("".getBytes()),
          options);
        break;
      case DELETE:
        response = client.delete(
          CHECK_CACHE_INVALIDATE,
          options);
        break;
    }
    response.release();
   
    options.setHeader("x-reqnum", "3");
    response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    resp1 = getResponse(response);
    response.release();
    assertEquals(resp1, "3");
View Full Code Here

Examples of org.apache.abdera.protocol.client.RequestOptions

  }
 
  private void _requestCacheInvalidation(int type) throws Exception {
   
    Client client = new CommonsClient();
    RequestOptions options = client.getDefaultRequestOptions();
    options.setHeader("Connection", "close");
    options.setHeader("x-reqnum", "1");
    ClientResponse response = client.get(CHECK_CACHE_INVALIDATE, options)
    String resp1 = getResponse(response);
    assertEquals(resp1, "1");
   
    // Should not use the cache
    options.setHeader("x-reqnum", "2");
    switch(type) {
      case NOCACHE: options.setNoCache(true); break;
      case NOSTORE: options.setNoStore(true); break;
      case MAXAGE0: options.setMaxAge(0); break;
    }
    response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    String resp2 = getResponse(response);
    assertEquals(resp2, "2");
   
    // Should use the cache
    options.setHeader("x-reqnum", "3");
    switch(type) {
      case NOCACHE: options.setNoCache(false); break;
      case NOSTORE: options.setNoStore(false); break;
      case MAXAGE0: options.setMaxAge(60); break;
    }
    response = client.get(CHECK_CACHE_INVALIDATE, options);
 
    String resp3 = getResponse(response);
    assertEquals(resp3, "2");
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.