public interface Request
forUri(String, String)
methods, and headers and payload can
be added using withHeader(String, String)
and withPayload(ByteString)
.Modifier and Type | Method and Description |
---|---|
Request |
clearHeaders()
Creates a new
Request based on this, but with no header information. |
static Request |
forUri(String uri)
Creates a
Request for the given uri. |
static Request |
forUri(String uri,
String method)
Creates a
Request for the given uri and method. |
default Optional<String> |
header(String name)
A header of the request message, or empty if no header with that name is found.
|
Map<String,String> |
headers()
The headers of the request message.
|
String |
method()
The method of the request message.
|
default Optional<String> |
parameter(String parameter)
A uri query parameter of the request message, or empty if no parameter with that name is found.
|
Map<String,List<String>> |
parameters()
The uri query parameters of the request message.
|
Optional<okio.ByteString> |
payload()
The request message payload, or empty if there is no payload.
|
Optional<String> |
service()
The calling service of the request, if known.
|
default Optional<Duration> |
ttl()
The request ttl.
|
String |
uri()
The uri of the request message.
|
Request |
withHeader(String name,
String value)
Creates a new
Request based on this, but with an additional header. |
Request |
withHeaders(Map<String,String> additionalHeaders)
Creates a new
Request based on this, but with additional headers. |
Request |
withPayload(okio.ByteString payload)
Creates a new
Request based on this, but with a different payload. |
Request |
withService(String service)
Creates a new
Request based on this, but with a different calling service. |
default Request |
withTtl(Duration ttl)
Creates a new
Request based on this, but with a different ttl. |
Request |
withUri(String uri)
Creates a new
Request based on this, but with a different URI. |
String method()
String uri()
parameter(String)
and parameters()
.
Uri pathArgs are available in RequestContext
.default Optional<String> parameter(String parameter)
parameters()
to get
all repeated values.default Optional<String> header(String name)
Optional<okio.ByteString> payload()
Request withUri(String uri)
Request
based on this, but with a different URI.uri
- the new uriRequest withService(String service)
Request
based on this, but with a different calling service.service
- the new serviceRequest withHeader(String name, String value)
Request
based on this, but with an additional header.name
- Header name to addvalue
- Header valueRequest withHeaders(Map<String,String> additionalHeaders)
Request
based on this, but with additional headers. If the current
request has a header whose key is also included in the additionalHeaders
map,
then the new request will have the header value defined in the map.additionalHeaders
- map of headers to addRequest clearHeaders()
Request
based on this, but with no header information.Request withPayload(okio.ByteString payload)
Request
based on this, but with a different payload.payload
- the new payloaddefault Request withTtl(Duration ttl)
Request
based on this, but with a different ttl.ttl
- The durationstatic Request forUri(String uri, String method)
Request
for the given uri and method.uri
- The requested urimethod
- The request methodCopyright © 2016. All rights reserved.