public interface ServerHttpExchange extends Wrapper
| Modifier and Type | Method and Description |
|---|---|
ServerHttpExchange |
bodyAction(Action<Data> action)
Attaches an action to be called with the whole request body where the
request ends.
|
ServerHttpExchange |
close()
Closes the response.
|
ServerHttpExchange |
close(ByteBuffer byteBuffer)
Writes a byte to the response body and close the response.
|
ServerHttpExchange |
close(String data)
Writes a string to the response body and close the response.
|
ServerHttpExchange |
closeAction(Action<Void> action)
Attaches an action to be called on response close.
|
String |
header(String name)
Returns the first request header associated with the given name.
|
Set<String> |
headerNames()
The names of the request headers.
|
List<String> |
headers(String name)
Returns the request headers associated with the given name or empty list
if no header is found.
|
String |
method()
The name of the request method.
|
ServerHttpExchange |
setHeader(String name,
Iterable<String> value)
Sets response headers.
|
ServerHttpExchange |
setHeader(String name,
String value)
Sets a response header.
|
ServerHttpExchange |
setStatus(HttpStatus status)
Sets the HTTP status for the response.
|
String |
uri()
The request URI used to connect.
|
ServerHttpExchange |
write(ByteBuffer byteBuffer)
Writes a byte body to the response body.
|
ServerHttpExchange |
write(String data)
Writes a text to the response body.
|
String uri()
String method()
Set<String> headerNames()
Set is case-sensitive. When iterating the set unlike getting the
header value, you should make it lower-case or upper-case and use it.List<String> headers(String name)
ServerHttpExchange bodyAction(Action<Data> action)
ServerHttpExchange setHeader(String name, String value)
ServerHttpExchange setHeader(String name, Iterable<String> value)
ServerHttpExchange write(String data)
ServerHttpExchange write(ByteBuffer byteBuffer)
ServerHttpExchange close()
ServerHttpExchange close(String data)
ServerHttpExchange close(ByteBuffer byteBuffer)
ServerHttpExchange setStatus(HttpStatus status)
ServerHttpExchange closeAction(Action<Void> action)
Copyright 2014, The Vibe Project