接口 ServerHttpRequest.Builder
- 封闭接口:
- ServerHttpRequest
public static interface ServerHttpRequest.Builder
Builder for mutating an existingServerHttpRequest.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ServerHttpRequestbuild()Build aServerHttpRequestdecorator with the mutated properties.ServerHttpRequest.BuildercontextPath(String contextPath)Set the contextPath to use.ServerHttpRequest.Builderheader(String headerName, String... headerValues)Set or override the specified header values under the given name.ServerHttpRequest.Builderheaders(Consumer<HttpHeaders> headersConsumer)Manipulate request headers.ServerHttpRequest.Buildermethod(HttpMethod httpMethod)Set the HTTP method to return.ServerHttpRequest.Builderpath(String path)Set the path to use instead of the"rawPath"of the URI of the request with the following conditions: Ifuriis also set, the path given here overrides the path of the given URI.ServerHttpRequest.BuildersslInfo(SslInfo sslInfo)Set the SSL session information.ServerHttpRequest.Builderuri(URI uri)Set the URI to use with the following conditions: Ifpathis also set, it overrides the path of the URI provided here.
方法详细资料
method
ServerHttpRequest.Builder method(HttpMethod httpMethod)
Set the HTTP method to return.
uri
ServerHttpRequest.Builder uri(URI uri)
Set the URI to use with the following conditions:- If
pathis also set, it overrides the path of the URI provided here. - If
contextPathis also set, or already present, it must match the start of the path of the URI provided here.
- If
path
ServerHttpRequest.Builder path(String path)
Set the path to use instead of the"rawPath"of the URI of the request with the following conditions:- If
uriis also set, the path given here overrides the path of the given URI. - If
contextPathis also set, or already present, it must match the start of the path given here. - The given value must begin with a slash.
- If
contextPath
ServerHttpRequest.Builder contextPath(String contextPath)
Set the contextPath to use.The given value must be a valid
contextPathand it must match the start of the path of the URI of the request. That means changing the contextPath, implies also changing the path viapath(String).
header
ServerHttpRequest.Builder header(String headerName, String... headerValues)
Set or override the specified header values under the given name.If you need to add header values, remove headers, etc., use
headers(Consumer)for greater control.- 参数:
headerName- the header nameheaderValues- the header values- 从以下版本开始:
- 5.1.9
- 另请参阅:
headers(Consumer)
headers
ServerHttpRequest.Builder headers(Consumer<HttpHeaders> headersConsumer)
Manipulate request headers. The providedHttpHeaderscontains current request headers, so that theConsumercan overwrite or remove existing values, or use any otherHttpHeadersmethods.
sslInfo
ServerHttpRequest.Builder sslInfo(SslInfo sslInfo)
Set the SSL session information. This may be useful in environments where TLS termination is done at the router, but SSL information is made available in some other way such as through a header.- 从以下版本开始:
- 5.0.7
build
ServerHttpRequest build()
Build aServerHttpRequestdecorator with the mutated properties.