public abstract class HttpClientRequestBase extends Object implements HttpClientRequest
| Modifier and Type | Field and Description |
|---|---|
protected HttpClientImpl |
client |
protected ContextInternal |
context |
protected SocketAddress |
server |
protected boolean |
ssl |
protected HttpClientStream |
stream |
| Modifier and Type | Method and Description |
|---|---|
String |
absoluteURI() |
protected String |
authority() |
String |
getHost() |
HttpMethod |
getMethod()
The HTTP method for the request.
|
int |
getPort() |
String |
getURI() |
String |
path() |
HttpClientRequest |
pushHandler(Handler<HttpClientRequest> handler)
Set a push handler for this request.
The handler is called when the client receives a push promise from the server.
|
String |
query() |
boolean |
reset(long code)
Reset this request:
for HTTP/2, this performs send an HTTP/2 reset frame with the specified error
code
for HTTP/1.x, this closes the connection when the current request is inflight
When the request has not yet been sent, the request will be aborted and false is returned as indicator. |
boolean |
reset(long code,
Throwable cause)
Reset this request:
for HTTP/2, send an HTTP/2 reset frame with the specified error
code
for HTTP/1.x, close the connection when the current request is inflight
When the request has not yet been sent, the request will be aborted and false is returned as indicator. |
Future<HttpClientResponse> |
response() |
HttpClientRequest |
response(Handler<AsyncResult<HttpClientResponse>> handler)
Set a callback for the associated
HttpClientResponse. |
HttpClientRequest |
setHost(String host)
Set the host value of the HTTP/1.1
host header or HTTP/2 authority pseudo header |
HttpClientRequest |
setMethod(HttpMethod method)
Set the HTTP method for this request.
|
HttpClientRequest |
setPort(int port)
Set the port value of the HTTP/1.1
host header or HTTP/2 authority pseudo header |
HttpClientRequest |
setTimeout(long timeoutMs)
Set's the amount of time after which if the request does not return any data within the timeout period an
TimeoutException will be passed to the exception handler (if provided) and
the request will be closed. |
HttpClientRequest |
setURI(String uri)
Set the request uri.
|
int |
streamId() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, connect, connection, continueHandler, drainHandler, end, end, end, end, end, end, end, end, exceptionHandler, getStreamPriority, headers, isChunked, putHeader, putHeader, putHeader, putHeader, reset, send, send, send, send, send, send, send, send, sendHead, sendHead, setChunked, setFollowRedirects, setMaxRedirects, setStreamPriority, setWriteQueueMaxSize, version, write, write, write, write, writeCustomFrame, writeCustomFramewrite, write, writeQueueFullprotected final HttpClientImpl client
protected final ContextInternal context
protected final HttpClientStream stream
protected final SocketAddress server
protected final boolean ssl
protected String authority()
public int streamId()
streamId in interface HttpClientRequestpublic String absoluteURI()
absoluteURI in interface HttpClientRequestpublic String query()
query in interface HttpClientRequestpublic String path()
path in interface HttpClientRequestpublic String getURI()
getURI in interface HttpClientRequestpublic HttpClientRequest setURI(String uri)
HttpClientRequestsetURI in interface HttpClientRequesturi - the request uripublic String getHost()
getHost in interface HttpClientRequesthost header or HTTP/2 authority pseudo headerpublic HttpClientRequest setHost(String host)
HttpClientRequesthost header or HTTP/2 authority pseudo header
The initial value is the same than the server socket address host.
Keep in mind that changing this value won't change the actual server socket address for this request.
setHost in interface HttpClientRequesthost - the host part of the HTTP/1.1 host header or HTTP/2 authority pseudo headerpublic int getPort()
getPort in interface HttpClientRequesthost header or HTTP/2 authority pseudo headerpublic HttpClientRequest setPort(int port)
HttpClientRequesthost header or HTTP/2 authority pseudo header
Keep in mind that this won't change the actual server socket address for this request.
The initial value is the same than the server socket address port.
setPort in interface HttpClientRequestport - the port part of the HTTP/1.1 host header or HTTP/2 authority pseudo headerpublic HttpMethod getMethod()
HttpClientRequestgetMethod in interface HttpClientRequestpublic HttpClientRequest setMethod(HttpMethod method)
HttpClientRequestsetMethod in interface HttpClientRequestmethod - the HTTP methodpublic HttpClientRequest setTimeout(long timeoutMs)
HttpClientRequestTimeoutException will be passed to the exception handler (if provided) and
the request will be closed.
Calling this method more than once has the effect of canceling any existing timeout and starting the timeout from scratch.
setTimeout in interface HttpClientRequesttimeoutMs - The quantity of time in milliseconds.public boolean reset(long code)
HttpClientRequestcodereset in interface HttpClientRequestcode - the error codetrue when reset has been performedpublic boolean reset(long code,
Throwable cause)
HttpClientRequestcodefalse is returned as indicator.
reset in interface HttpClientRequestcode - the error codecause - an optional cause that can be attached to the error codepublic HttpClientRequest response(Handler<AsyncResult<HttpClientResponse>> handler)
HttpClientRequestHttpClientResponse.
This method does not modify the current request being sent.
response in interface HttpClientRequesthandler - the completion handlerpublic Future<HttpClientResponse> response()
response in interface HttpClientRequestHttpClientResponse, see HttpClientRequest.response(Handler)public HttpClientRequest pushHandler(Handler<HttpClientRequest> handler)
HttpClientRequestHttpClientRequest, the following methods can be called:
In addition the handler should call the HttpClientRequest.response(Handler) method to set an handler to
process the response.pushHandler in interface HttpClientRequesthandler - the handlerCopyright © 2021. All rights reserved.