Package org.expath.httpclient

Examples of org.expath.httpclient.HttpRequest


        return sendRequest(request, href, bodies);
    }
   
    private Sequence sendRequest(final NodeValue request, final String href, final Sequence bodies) throws XPathException {
       
        HttpRequest req = null;
        try {
            final org.expath.httpclient.model.Sequence b = new EXistSequence(bodies, getContext());
            final Element r = new EXistElement(request, getContext());
            final RequestParser parser = new RequestParser();
            req = parser.parse(r, b, href);

            // override anyway it href exists
            if (href != null && ! "".equals(href) ) {
                req.setHref(href);
            }
       
            final URI uri = new URI(req.getHref());
            final EXistResult result = sendOnce(uri, req, parser);
            return result.getResult();
               
        } catch(final URISyntaxException ex ) {
            throw new XPathException("Href is not valid: " + req != null ? req.getHref() : "" + ". " + ex.getMessage(), ex);
        } catch(final HttpClientException hce) {
            throw new XPathException(hce.getMessage(), hce);
        }
    }
View Full Code Here

TOP

Related Classes of org.expath.httpclient.HttpRequest

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.