Search in sources :

Example 1 with HttpURLConnectionContentProcessor

use of br.com.caelum.restfulie.http.HttpURLConnectionContentProcessor in project restfulie-java by caelum.

the class JavaNetDispatcher method access.

private Response access(Request request, String verb, URI uri) {
    try {
        HttpURLConnection connection = prepareConnectionWith(request.getHeaders(), uri);
        connection.setDoOutput(false);
        connection.setRequestMethod(verb);
        JavaNetResponse response = responseFor(connection, new HttpURLConnectionContentProcessor(connection), request);
        return response;
    } catch (IOException e) {
        throw new RestfulieException("Unable to execute " + uri, e);
    }
}
Also used : HttpURLConnection(java.net.HttpURLConnection) RestfulieException(br.com.caelum.restfulie.RestfulieException) HttpURLConnectionContentProcessor(br.com.caelum.restfulie.http.HttpURLConnectionContentProcessor) IOException(java.io.IOException)

Aggregations

RestfulieException (br.com.caelum.restfulie.RestfulieException)1 HttpURLConnectionContentProcessor (br.com.caelum.restfulie.http.HttpURLConnectionContentProcessor)1 IOException (java.io.IOException)1 HttpURLConnection (java.net.HttpURLConnection)1