Examples of post()


Examples of org.drools.repository.remoteapi.RestAPI.post()

                new Command() {
                    public void execute() throws Exception {
                        res.setContentType("text/html");
                        RestAPI api = getAPI();
                        String comment = req.getHeader("Checkin-Comment");
                        api.post(req.getRequestURI(),
                                req.getInputStream(),
                                (comment != null) ? comment : "");
                        res.getWriter().write("OK");
                    }
                });
View Full Code Here

Examples of org.eclipse.jetty.client.HttpClient.POST()

                client.start();
                try
                {
                    // Perform one request to server1 to create a session
                    int value = 1;
                    Request request1 = client.POST("http://localhost:" + port1 + contextPath + servletMapping + "?action=set&value=" + value);
                    ContentResponse response1 = request1.send();
                    assertEquals(HttpServletResponse.SC_OK,response1.getStatus());
                    String sessionCookie = response1.getHeaders().get("Set-Cookie");
                    assertTrue(sessionCookie != null);
                    // Mangle the cookie, replacing Path with $Path, etc.
View Full Code Here

Examples of org.eclipse.swt.widgets.Display.post()

    }
   
    private static void postEvent(Event e)
    {
        Display display = Display.getDefault();
        display.post(e);
        while (display.readAndDispatch());
        try { Thread.sleep(2); } catch (InterruptedException _) { }
    }
}
View Full Code Here

Examples of org.exoplatform.common.http.client.HTTPConnection.Post()

         connection.addBasicAuthorization(getRealm(complURL), login, password);

         HTTPResponse resp;
         if (postData == null)
         {
            resp = connection.Post(url.getFile());
         }
         else
         {
            NVPair[] pairs = new NVPair[2];
            pairs[0] = new NVPair("Content-Type", "application/json; charset=UTF-8");
View Full Code Here

Examples of org.fusesource.restygwt.client.Resource.post()

        // Initialize the pizza service..
        Resource resource = new Resource(GWT.getModuleBaseURL() + "pizza-service");

        JSONValue request = createRequestObject();

        resource.post().json(request).send(new JsonCallback() {
            public void onSuccess(Method method, JSONValue response) {
                assertNotNull(response);
                System.out.println(response);
                finishTest();
            }
View Full Code Here

Examples of org.geotools.data.ows.HTTPClient.post()

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            request.performPostOutput(out);
            InputStream in = new ByteArrayInputStream(out.toByteArray());

            try {
                httpResponse = httpClient.post(finalURL, in, postContentType);
            } finally {
                in.close();
            }
        } else {
            httpResponse = httpClient.get(finalURL);
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.post()

      Product product = new Product();
      product.setName("iPhone");
      product.setCost(199.99);
      request.body("application/xml", product);
      response = request.post();
      response.releaseConnection();
      Assert.assertEquals(201, response.getStatus());

      product = new Product();
      product.setName("MacBook Pro");
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.post()

      String xml = "<resteasy:collection xmlns:resteasy=\"http://jboss.org/resteasy\">"
              + "<foo test=\"hello\"/></resteasy:collection>";

      ClientRequest request = new ClientRequest(generateURL("/array"));
      request.body("application/xml", xml);
      ClientResponse<List<Foo>> response = request.post(new GenericType<List<Foo>>()
      {
      });
      List<Foo> list = response.getEntity();
      Assert.assertEquals(1, list.size());
      Assert.assertEquals(list.get(0).getTest(), "hello");
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.post()

      String xml = "<list>"
              + "<foo test=\"hello\"/></list>";

      ClientRequest request = new ClientRequest(generateURL("/list"));
      request.body("application/xml", xml);
      ClientResponse<Foo[]> response = request.post(new GenericType<Foo[]>()
      {
      });
      Foo[] list = response.getEntity();
      Assert.assertEquals(1, list.length);
      Assert.assertEquals(list[0].getTest(), "hello");
View Full Code Here

Examples of org.jclouds.rest.HttpClient.post()

      Payload fakePayload = new StringPayload("");
      fakePayload.getContentMetadata().setContentLength(reallyLongContent);

      try {
         try {
            client.post(server.getUrl("/").toURI(), fakePayload);
            fail("Should have errored since we didn't sent that much data!");
         } catch (HttpResponseException expected) {
         }
         assertEquals(server.takeRequest().getHeader(CONTENT_LENGTH), String.valueOf(reallyLongContent));
      } finally {
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.