Package com.sun.jersey.client.impl

Examples of com.sun.jersey.client.impl.ClientRequestImpl


      headers.add("Content-Type", "application/json");
    }
    try {
      ClientResponse response = null;
      if (request.entity() != null && request.entity().getEntity() != null) {
        response = target.getHeadHandler().handle(new ClientRequestImpl(target.getURI(), request.method().name(), request.entity().getEntity(), headers));
      } else {
        response = target.getHeadHandler().handle(new ClientRequestImpl(target.getURI(), request.method().name(), null, headers));
      }
      return new JerseyResponse(response);
    } catch (UniformInterfaceException e) {
      throw new OpenStackResponseException(e.getResponse().getClientResponseStatus().getReasonPhrase(), e.getResponse().getStatus());
    }
View Full Code Here


    headers.add(HmacUtils.X_HMAC_DATE, "Sat, 01 Jan 2000 12:34:57 GMT");
    headers.add(HmacUtils.X_HMAC_NONCE, "Thohn2Mohd2zugo");

    URI uri = new URI(baseUri + resourcePath + queryParameters);

    ClientRequest clientRequest = new ClientRequestImpl(uri, "get", null, headers);

    String representation = HmacUtils.createCanonicalRepresentation(clientRequest, providers);

    FixtureAsserts.assertStringMatchesStringFixture("GET canonical representation", representation, "/fixtures/hmac/expected-canonical-get.txt");
View Full Code Here

    URI uri = new URI(baseUri + resourcePath + queryParameters);

    String entity = "{\"_links\":{\"self\":{\"href\":\"http://example.org/user\"}}}";

    ClientRequest clientRequest = new ClientRequestImpl(uri, "post", entity, headers);

    String representation = HmacUtils.createCanonicalRepresentation(clientRequest, providers);

    FixtureAsserts.assertStringMatchesStringFixture("POST canonical representation", representation, "/fixtures/hmac/expected-canonical-post.txt");
View Full Code Here

         * @param uri the URI of the request.
         * @param method the HTTP method.
         * @return the client request.
         */
        public ClientRequest build(URI uri, String method) {
            ClientRequest ro = new ClientRequestImpl(uri, method, entity, metadata);
            entity = null;
            metadata = null;
            return ro;
        }
View Full Code Here

    // UniformInterface
   
    @Override
    public ClientResponse head() throws ClientHandlerException{
        return getHeadHandler().handle(new ClientRequestImpl(getURI(), "HEAD"));
    }
View Full Code Here

        return getHeadHandler().handle(new ClientRequestImpl(getURI(), "HEAD"));
    }
       
    @Override
    public <T> T options(Class<T> c) throws UniformInterfaceException, ClientHandlerException {
        return handle(c, new ClientRequestImpl(getURI(), "OPTIONS"));
    }
View Full Code Here

        return handle(c, new ClientRequestImpl(getURI(), "OPTIONS"));
    }
       
    @Override
    public <T> T options(GenericType<T> gt) throws UniformInterfaceException, ClientHandlerException {
        return handle(gt, new ClientRequestImpl(getURI(), "OPTIONS"));           
    }
View Full Code Here

        return handle(gt, new ClientRequestImpl(getURI(), "OPTIONS"));           
    }
       
    @Override
    public <T> T get(Class<T> c) throws UniformInterfaceException, ClientHandlerException {
        return handle(c, new ClientRequestImpl(getURI(), "GET"));
    }
View Full Code Here

        return handle(c, new ClientRequestImpl(getURI(), "GET"));
    }
           
    @Override
    public <T> T get(GenericType<T> gt) throws UniformInterfaceException, ClientHandlerException {
        return handle(gt, new ClientRequestImpl(getURI(), "GET"));           
    }
View Full Code Here

        return handle(gt, new ClientRequestImpl(getURI(), "GET"));           
    }
       
    @Override
    public void put() throws UniformInterfaceException, ClientHandlerException {
        voidHandle(new ClientRequestImpl(getURI(), "PUT", null));
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.client.impl.ClientRequestImpl

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.