public class HttpUrlConnectionCall extends ClientCall
Constructor and Description |
---|
HttpUrlConnectionCall(HttpClientHelper helper,
java.lang.String method,
java.lang.String requestUri,
boolean hasEntity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.net.HttpURLConnection |
getConnection()
Returns the connection.
|
HttpClientHelper |
getHelper()
Returns the HTTP client helper.
|
java.lang.String |
getReasonPhrase()
Returns the response reason phrase.
|
protected Representation |
getRepresentation(java.io.InputStream stream)
Returns the representation wrapping the given stream.
|
java.nio.channels.WritableByteChannel |
getRequestEntityChannel()
Returns the request entity channel if it exists.
|
java.io.OutputStream |
getRequestEntityStream()
Returns the request entity stream if it exists.
|
java.io.OutputStream |
getRequestHeadStream()
Returns the request head stream if it exists.
|
java.io.OutputStream |
getRequestStream()
Returns the request entity stream if it exists.
|
java.nio.channels.ReadableByteChannel |
getResponseEntityChannel(long size)
Returns the response channel if it exists.
|
java.io.InputStream |
getResponseEntityStream(long size)
Returns the response entity stream if it exists.
|
Series<Header> |
getResponseHeaders()
Returns the modifiable list of response headers.
|
java.lang.String |
getServerAddress()
Returns the response address.
|
int |
getStatusCode()
Returns the response status code.
|
Status |
sendRequest(Request request)
Sends the request to the client.
|
void |
sendRequest(Request request,
Response response,
Uniform callback)
Sends the request to the client.
|
getContentLength, getLocalAddress, getResponseEntity, isClientKeepAlive, isServerKeepAlive, shouldRequestBeChunked
getClientAddress, getClientPort, getHostDomain, getHostPort, getLogger, getMethod, getProtocol, getRepresentation, getRequestHeaders, getRequestUri, getServerPort, getUserPrincipal, getVersion, isBroken, isConfidential, isKeepAlive, isRequestChunked, isResponseChunked, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setUserPrincipal, setVersion
public HttpUrlConnectionCall(HttpClientHelper helper, java.lang.String method, java.lang.String requestUri, boolean hasEntity) throws java.io.IOException
helper
- The parent HTTP client helper.method
- The method name.requestUri
- The request URI.hasEntity
- Indicates if the call will have an entity to send to the
server.java.io.IOException
public java.net.HttpURLConnection getConnection()
public HttpClientHelper getHelper()
getHelper
in class ClientCall
public java.lang.String getReasonPhrase()
getReasonPhrase
in class Call
protected Representation getRepresentation(java.io.InputStream stream)
Call
getRepresentation
in class Call
stream
- The response input stream.public java.nio.channels.WritableByteChannel getRequestEntityChannel()
ClientCall
getRequestEntityChannel
in class ClientCall
public java.io.OutputStream getRequestEntityStream()
ClientCall
getRequestEntityStream
in class ClientCall
public java.io.OutputStream getRequestHeadStream()
ClientCall
getRequestHeadStream
in class ClientCall
public java.io.OutputStream getRequestStream()
public java.nio.channels.ReadableByteChannel getResponseEntityChannel(long size)
ClientCall
getResponseEntityChannel
in class ClientCall
size
- The expected entity size or -1 if unknown.public java.io.InputStream getResponseEntityStream(long size)
ClientCall
getResponseEntityStream
in class ClientCall
size
- The expected entity size or -1 if unknown.public Series<Header> getResponseHeaders()
getResponseHeaders
in class Call
public java.lang.String getServerAddress()
getServerAddress
in class Call
public int getStatusCode() throws java.io.IOException
getStatusCode
in class Call
java.io.IOException
java.io.IOException
public Status sendRequest(Request request)
sendRequest
in class ClientCall
request
- The high-level request.public void sendRequest(Request request, Response response, Uniform callback) throws java.lang.Exception
ClientCall
sendRequest
in class ClientCall
request
- The high-level request.response
- The high-level response.callback
- The callback invoked upon request completion.java.lang.Exception
Copyright © 2005-2024 Restlet.