Package org.restlet

Examples of org.restlet.Client


        super.setUp();
        c = new Component();
        c.getServers().add(Protocol.HTTP, 8111);
        c.getDefaultHost().attach(new TestApplication());
        c.start();
        client = new Client(Protocol.HTTP);
    }
View Full Code Here


     * @throws IOException
     * @throws ResourceException
     */
    public void test() throws IOException, ResourceException {

        client = new Client(Protocol.HTTP);
        Request request = new Request(Method.GET, "http://localhost:8111/test");
        Response response = client.handle(request);
        assertEquals(Status.SUCCESS_OK, response.getStatus());
        assertEquals("asText-txt", response.getEntity().getText());
        response.getEntity().release();
View Full Code Here

     * @param feedUri
     *            The feed URI.
     * @throws IOException
     */
    public Feed(String feedUri) throws IOException {
        this(new Client(new Reference(feedUri).getSchemeProtocol()), feedUri);
    }
View Full Code Here

     * @param protocol
     *            The connector protocol.
     * @return The added client.
     */
    public Client add(Protocol protocol) {
        final Client result = new Client(protocol);
        result.setContext(getContext().createChildContext());
        add(result);
        return result;
    }
View Full Code Here

     * @param entryUri
     *            The entry URI.
     * @throws IOException
     */
    public Entry(String entryUri) throws IOException {
        this(new Client(new Reference(entryUri).getSchemeProtocol()), entryUri);
    }
View Full Code Here

     * @param serviceUri
     *            The service URI.
     * @throws IOException
     */
    public Service(String serviceUri) throws IOException {
        this(new Client(new Reference(serviceUri).getSchemeProtocol()),
                serviceUri);
    }
View Full Code Here

     *            The XML introspection document.
     * @throws IOException
     */
    public Service(String serviceUri, Representation xmlService)
            throws IOException {
        this(new Client(new Reference(serviceUri).getSchemeProtocol()),
                serviceUri, xmlService);
    }
View Full Code Here

        c = new Component();
        c.getServers().add(Protocol.HTTP, 8111);
        c.getDefaultHost().attach(new TestApplication());
        c.start();

        client = new Client(Protocol.HTTP);
    }
View Full Code Here

        String text = "text";
        Form form = new Form();
        form.add("key", "value");

        client = new Client(Protocol.HTTP);
        Request request = new Request(method, "http://localhost:8111/test");
        Response response = client.handle(request);
        assertTrue(response.getStatus().isSuccess());
        response.getEntity().release();
View Full Code Here

        String text = "text";
        Form form = new Form();
        form.add("key", "value");

        client = new Client(Protocol.HTTP);
        Request request = new Request(method, "http://localhost:8111/test");
        Response response = client.handle(request);
        assertTrue(response.getStatus().isSuccess());
        response.getEntity().release();
View Full Code Here

TOP

Related Classes of org.restlet.Client

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.