Package | Description |
---|---|
io.vertx.core.http |
== Writing HTTP servers and clients
Vert.x allows you to easily write non blocking HTTP clients and servers.
|
io.vertx.core.spi.metrics |
Modifier and Type | Method and Description |
---|---|
HttpServerResponse |
HttpServerResponse.bodyEndHandler(Handler<Void> handler)
Provide a handler that will be called just before the last part of the body is written to the wire
and the response is ended.
|
HttpServerResponse |
HttpServerResponse.closeHandler(Handler<Void> handler)
Set a close handler for the response.
|
HttpServerResponse |
HttpServerResponse.drainHandler(Handler<Void> handler) |
HttpServerResponse |
HttpServerResponse.exceptionHandler(Handler<Throwable> handler) |
HttpServerResponse |
HttpServerResponse.headersEndHandler(Handler<Void> handler)
Provide a handler that will be called just before the headers are written to the wire.
|
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String path,
Handler<AsyncResult<HttpServerResponse>> handler)
Like
push(HttpMethod, String, String, MultiMap, Handler) with the host copied from the current request. |
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String path,
MultiMap headers,
Handler<AsyncResult<HttpServerResponse>> handler)
Like
push(HttpMethod, String, String, MultiMap, Handler) with the host copied from the current request. |
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String host,
String path,
Handler<AsyncResult<HttpServerResponse>> handler)
Like
push(HttpMethod, String, String, MultiMap, Handler) with no headers. |
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String host,
String path,
MultiMap headers,
Handler<AsyncResult<HttpServerResponse>> handler)
Push a response to the client.
The
handler will be notified with a success when the push can be sent and with
a failure when the client has disabled push or reset the push before it has been sent.
The handler may be queued if the client has reduced the maximum number of streams the server can push
concurrently.
Push can be sent only for peer initiated streams and if the response is not ended. |
HttpServerResponse |
HttpServerResponse.putHeader(CharSequence name,
CharSequence value)
Like
putHeader(String, String) but using CharSequence |
HttpServerResponse |
HttpServerResponse.putHeader(CharSequence name,
Iterable<CharSequence> values)
Like
putHeader(String, Iterable) but with CharSequence Iterable |
HttpServerResponse |
HttpServerResponse.putHeader(String name,
Iterable<String> values)
Like
putHeader(String, String) but providing multiple values via a String Iterable |
HttpServerResponse |
HttpServerResponse.putHeader(String name,
String value)
Put an HTTP header
|
HttpServerResponse |
HttpServerResponse.putTrailer(CharSequence name,
CharSequence value)
Like
putTrailer(String, String) but using CharSequence |
HttpServerResponse |
HttpServerResponse.putTrailer(CharSequence name,
Iterable<CharSequence> value)
Like
putTrailer(String, Iterable) but with CharSequence Iterable |
HttpServerResponse |
HttpServerResponse.putTrailer(String name,
Iterable<String> values)
Like
putTrailer(String, String) but providing multiple values via a String Iterable |
HttpServerResponse |
HttpServerResponse.putTrailer(String name,
String value)
Put an HTTP trailer
|
HttpServerResponse |
HttpServerRequest.response() |
default HttpServerResponse |
HttpServerResponse.sendFile(String filename)
Same as
sendFile(String, long) using offset @code{0} which means starting from the beginning of the file. |
default HttpServerResponse |
HttpServerResponse.sendFile(String filename,
Handler<AsyncResult<Void>> resultHandler)
Like
sendFile(String) but providing a handler which will be notified once the file has been completely
written to the wire. |
default HttpServerResponse |
HttpServerResponse.sendFile(String filename,
long offset)
Same as
sendFile(String, long, long) using length @code{Long.MAX_VALUE} which means until the end of the
file. |
default HttpServerResponse |
HttpServerResponse.sendFile(String filename,
long offset,
Handler<AsyncResult<Void>> resultHandler)
Like
sendFile(String, long) but providing a handler which will be notified once the file has been completely
written to the wire. |
HttpServerResponse |
HttpServerResponse.sendFile(String filename,
long offset,
long length)
Ask the OS to stream a file as specified by
filename directly
from disk to the outgoing connection, bypassing userspace altogether
(where supported by the underlying operating system. |
HttpServerResponse |
HttpServerResponse.sendFile(String filename,
long offset,
long length,
Handler<AsyncResult<Void>> resultHandler)
Like
sendFile(String, long, long) but providing a handler which will be notified once the file has been
completely written to the wire. |
HttpServerResponse |
HttpServerResponse.setChunked(boolean chunked)
If
chunked is true , this response will use HTTP chunked encoding, and each call to write to the body
will correspond to a new HTTP chunk sent on the wire. |
HttpServerResponse |
HttpServerResponse.setStatusCode(int statusCode)
Set the status code.
|
HttpServerResponse |
HttpServerResponse.setStatusMessage(String statusMessage)
Set the status message
|
HttpServerResponse |
HttpServerResponse.setWriteQueueMaxSize(int maxSize) |
HttpServerResponse |
HttpServerResponse.write(Buffer data) |
HttpServerResponse |
HttpServerResponse.write(String chunk)
Write a
String to the response body, encoded in UTF-8. |
HttpServerResponse |
HttpServerResponse.write(String chunk,
String enc)
Write a
String to the response body, encoded using the encoding enc . |
HttpServerResponse |
HttpServerResponse.writeContinue()
Used to write an interim 100 Continue response to signify that the client should send the rest of the request.
|
default HttpServerResponse |
HttpServerResponse.writeCustomFrame(HttpFrame frame)
Like
writeCustomFrame(int, int, Buffer) but with an HttpFrame . |
HttpServerResponse |
HttpServerResponse.writeCustomFrame(int type,
int flags,
Buffer payload)
Write an HTTP/2 frame to the response, allowing to extend the HTTP/2 protocol.
|
Modifier and Type | Method and Description |
---|---|
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String path,
Handler<AsyncResult<HttpServerResponse>> handler)
Like
push(HttpMethod, String, String, MultiMap, Handler) with the host copied from the current request. |
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String path,
MultiMap headers,
Handler<AsyncResult<HttpServerResponse>> handler)
Like
push(HttpMethod, String, String, MultiMap, Handler) with the host copied from the current request. |
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String host,
String path,
Handler<AsyncResult<HttpServerResponse>> handler)
Like
push(HttpMethod, String, String, MultiMap, Handler) with no headers. |
HttpServerResponse |
HttpServerResponse.push(HttpMethod method,
String host,
String path,
MultiMap headers,
Handler<AsyncResult<HttpServerResponse>> handler)
Push a response to the client.
The
handler will be notified with a success when the push can be sent and with
a failure when the client has disabled push or reset the push before it has been sent.
The handler may be queued if the client has reduced the maximum number of streams the server can push
concurrently.
Push can be sent only for peer initiated streams and if the response is not ended. |
Modifier and Type | Method and Description |
---|---|
void |
HttpServerMetrics.responseEnd(R requestMetric,
HttpServerResponse response)
Called when an http server response has ended.
|
R |
HttpServerMetrics.responsePushed(S socketMetric,
HttpMethod method,
String uri,
HttpServerResponse response)
Called when an http server response is pushed.
|
Copyright © 2016. All rights reserved.