Interface WebClientServiceRequest
public interface WebClientServiceRequest
Request to SPI
WebClientService that supports modification of the outgoing request.-
Method Summary
Modifier and TypeMethodDescriptioncontext()Registry that can be used to propagate information from server (e.g.headers()Configured request headers.method()Returns an HTTP request method.Properties configured by user when creating this client request.Returns an HTTP protocol ID, mapped to a specific version.Request id which will be used in logging messages.voidSet new request id.uri()URI helper for this client request.Completes when processing of the request and response has finished.whenSent()Completes when the request part of this request is done (e.g.
-
Method Details
-
uri
-
method
Method method()Returns an HTTP request method. See alsoHTTP standard methodsutility class.- Returns:
- an HTTP method
- See Also:
-
protocolId
String protocolId()Returns an HTTP protocol ID, mapped to a specific version. This is the same ID that is used for ALPN (protocol negotiation) -http/1.1for HTTP/1.1 andh2for HTTP/2.The selected protocol may change while the downstream service chain executes, for example when an HTTP/2 client falls back to HTTP/1.1. The request exposes the selected wire protocol when the chain returns and through
whenSent()andwhenComplete().- Returns:
- protocol identifier, such as
http/1.1,h2, orh3
-
headers
-
context
Context context()Registry that can be used to propagate information from server (e.g. security context, tracing spans etc.).- Returns:
- registry propagated by the user
-
requestId
-
requestId
Set new request id. This id is used in logging messages.- Parameters:
requestId- new request id
-
whenSent
CompletionStage<WebClientServiceRequest> whenSent()Completes when the request part of this request is done (e.g. we have sent all headers and bytes).- Returns:
- completion stage that finishes when we fully send request (including entity) to server
-
whenComplete
CompletionStage<WebClientServiceResponse> whenComplete()Completes when processing of the request and response has finished. The exact completion point is protocol-specific and may follow a full entity read, explicit response close, or an entity-processing failure. Normal completion does not imply that the response entity was fully read successfully.- Returns:
- completion stage that finishes when request and response processing has completed
-
properties
-