Examples of sendRequest()


Examples of com.google.gwt.http.client.RequestBuilder.sendRequest()

    public void update(Resource resource, StatusResponseHandler handler) {
        RequestBuilder builder = buildPut(resource.getId());
        StatusResponseCallback requestCallback = new StatusResponseCallback(handler);
       
        try {
            Request response = builder.sendRequest(resource.toRepresentation(), requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
    }
   
View Full Code Here

Examples of com.google.gwt.http.client.RequestBuilder.sendRequest()

    public void delete(int id, StatusResponseHandler handler) {
        RequestBuilder builder = buildDelete(id);
        StatusResponseCallback requestCallback = new StatusResponseCallback(handler);
       
        try {
            Request response = builder.sendRequest(null, requestCallback);
        } catch (RequestException e) {
            handler.onError(null, e);
        }
    }
   
View Full Code Here

Examples of com.google.gwt.http.client.RequestBuilder.sendRequest()

        @Override
        void send(String message, final AsyncCallback<Void> callback) {
            RequestBuilder request = new RequestBuilder(RequestBuilder.POST, serviceUrl());
            try {
                request.sendRequest(message, new RequestCallback() {
                    @Override
                    public void onResponseReceived(Request request, Response response) {
                        // when a connection is abruptly closed (for instance when a user presses F5
                        // the statuscode seems to be 0, the call could have arrived at the server though
                        if (response.getStatusCode() != Response.SC_OK
View Full Code Here

Examples of com.google.gwt.jsonp.client.JsonpRequestBuilder.sendRequest()

      rb.setPredeterminedId(md5Hash);
      rb.requestObject(url, new ETRCallback(callback));
    } else {
      RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
      try {
        rb.sendRequest("", new ETRCallback(callback));
      } catch (RequestException e) {
        throw new ResourceException(this,
            "Unable to initiate request for external resource", e);
      }
    }
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.Session.sendRequest()

    String to = params.get("callTo").getAsString();
    Session toSession = registry.get(to).getSession();

    JsonObject icParams = new JsonObject();
    params.addProperty("from", name);
    JsonObject icResponse = (JsonObject) toSession.sendRequest(
        "incommingCall", icParams);

    String callResponse = icResponse.get("callResponse").getAsString();

    if ("Accept".equals(callResponse)) {
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.client.JsonRpcClient.sendRequest()

    JsonRpcClient client = createJsonRpcClient("/error_handler");

    try {

      client.sendRequest("explicitError");

      Assert.fail("An exception should be thrown");

    } catch (JsonRpcErrorException e) {
View Full Code Here

Examples of com.kurento.kmf.jsonrpcconnector.client.JsonRpcClientLocal.sendRequest()

    Params params = new Params();
    params.param1 = "Value1";
    params.param2 = "Value2";

    Params result = client.sendRequest("echo", params, Params.class);

    LOG.info("Response:" + result);

    Assert.assertEquals(params.param1, result.param1);
    Assert.assertEquals(params.param2, result.param2);
View Full Code Here

Examples of com.kurento.kmf.thrift.jsonrpcconnector.JsonRpcClientThrift.sendRequest()

    Params params = new Params();
    params.param1 = "Value1";
    params.param2 = "Value2";

    Params result = client.sendRequest("echo", params, Params.class);

    log.info("Response:" + result);

    Assert.assertEquals(params.param1, result.param1);
    Assert.assertEquals(params.param2, result.param2);
View Full Code Here

Examples of com.linkedin.databus.core.test.netty.SimpleTestHttpClient.sendRequest()

    HttpRequest httpRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1,
                                                     HttpMethod.GET, "/sources");

    SimpleTestHttpClient httpClient = SimpleTestHttpClient.createLocal(TimeoutPolicy.ALL_TIMEOUTS);
    SimpleHttpResponseHandler respHandler = httpClient.sendRequest(_serverAddress, httpRequest);

    assertTrue("failed to get a response", respHandler.awaitResponseUninterruptedly(1, TimeUnit.SECONDS));
    ByteArrayInputStream in = new ByteArrayInputStream(respHandler.getReceivedBytes());
    ObjectMapper objMapper = new ObjectMapper();
    List<IdNamePair> res = objMapper.readValue(in, new TypeReference<List<IdNamePair>>(){});
View Full Code Here

Examples of com.linkedin.restli.client.RestClient.sendRequest()

    Client r2Client = new TransportClientAdapter(new HttpClientFactory().getClient(Collections.<String, String>emptyMap()));
    RestClient restClient = new RestClient(r2Client, "http://localhost:1338/");

    // GET
    Request<Greeting> request = builders.get().id(1L).build();
    ResponseFuture<Greeting> future = restClient.sendRequest(request);
    Response<Greeting> greetingResponse = future.getResponse();

    Assert.assertNotNull(greetingResponse.getEntity().getMessage());

    // POST
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.