Package org.restlet.client

Examples of org.restlet.client.Request


     *
     * @param resource
     *            The client resource to copy.
     */
    public ClientResource(ClientResource resource) {
        Request request = new Request(resource.getRequest());
        Response response = new Response(request);
        this.next = resource.getNext();
        this.followingRedirects = resource.isFollowingRedirects();
        this.maxRedirects = resource.getMaxRedirects();
        this.retryOnError = resource.isRetryOnError();
View Full Code Here


     *            The method to call.
     * @param reference
     *            The target reference.
     */
    public ClientResource(Context context, Method method, Reference reference) {
        this(context, new Request(method, reference), new Response(null));
    }
View Full Code Here

     * @return The new response.
     * @deprecated Use {@link #createRequest()} instead
     */
    @Deprecated
    public Request createRequest(Request prototype) {
        return new Request(prototype);
    }
View Full Code Here

     * @return The optional response entity.
     * @see #getNext()
     */
    @Override
    public Representation handle() {
        Response response = handleOutbound(new Request(getRequest()));
        return (response == null) ? null : response.getEntity();
    }
View Full Code Here

     * @param entity
     *            The request entity to set.
     * @return The optional response entity.
     */
    protected Representation handle(Method method, Representation entity) {
        Request request = createRequest();
        request.setMethod(method);
        request.setEntity(entity);
        return handle(method, entity, getClientInfo());
    }
View Full Code Here

     * @return The optional response entity.
     */
    protected Representation handle(Method method, Representation entity,
            ClientInfo clientInfo) {
        // Prepare the request by cloning the prototype request
        Request request = createRequest();
        request.setMethod(method);
        request.setEntity(entity);
        request.setClientInfo(clientInfo);

        // Actually handle the call
        Response response = handleOutbound(request);
        return handleInbound(response);
    }
View Full Code Here

     *
     * @param resource
     *            The client resource to copy.
     */
    public ClientResource(ClientResource resource) {
        Request request = new Request(resource.getRequest());
        Response response = new Response(request);
        this.next = resource.getNext();
        this.followingRedirects = resource.isFollowingRedirects();
        this.maxRedirects = resource.getMaxRedirects();
        this.retryOnError = resource.isRetryOnError();
View Full Code Here

     *            The method to call.
     * @param reference
     *            The target reference.
     */
    public ClientResource(Context context, Method method, Reference reference) {
        this(context, new Request(method, reference), new Response(null));
    }
View Full Code Here

     * @param prototype
     *            The prototype request.
     * @return The new response.
     */
    public Request createRequest(Request prototype) {
        return new Request(prototype);
    }
View Full Code Here

     * @return The optional response entity.
     * @see #getNext()
     */
    @Override
    public Representation handle() {
        Response response = handle(new Request(getRequest()));
        return (response == null) ? null : response.getEntity();
    }
View Full Code Here

TOP

Related Classes of org.restlet.client.Request

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.