Interface SdkHttpRequest.Builder
-
- All Superinterfaces:
Buildable
,CopyableBuilder<SdkHttpRequest.Builder,SdkHttpRequest>
,SdkBuilder<SdkHttpRequest.Builder,SdkHttpRequest>
,SdkHttpHeaders
- All Known Subinterfaces:
SdkHttpFullRequest.Builder
- Enclosing interface:
- SdkHttpRequest
public static interface SdkHttpRequest.Builder extends CopyableBuilder<SdkHttpRequest.Builder,SdkHttpRequest>, SdkHttpHeaders
A mutable builder forSdkHttpFullRequest
. An instance of this can be created usingSdkHttpFullRequest.builder()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SdkHttpRequest.Builder
appendHeader(String headerName, String headerValue)
Add a single header to be included in the created HTTP request.SdkHttpRequest.Builder
appendRawQueryParameter(String paramName, String paramValue)
Add a single un-encoded query parameter to be included in the created HTTP request.SdkHttpRequest.Builder
clearHeaders()
Removes all headers from this builder.SdkHttpRequest.Builder
clearQueryParameters()
Removes all query parameters from this builder.String
encodedPath()
The path, exactly as it was configured withencodedPath(String)
.SdkHttpRequest.Builder
encodedPath(String path)
Configure anSdkHttpRequest.encodedPath()
to be used in the created HTTP request.default Optional<String>
encodedQueryParameters()
default void
forEachRawQueryParameter(BiConsumer<? super String,? super List<String>> consumer)
Map<String,List<String>>
headers()
The query parameters, exactly as they were configured withheaders(Map)
,putHeader(String, String)
andputHeader(String, List)
.SdkHttpRequest.Builder
headers(Map<String,List<String>> headers)
Configure anSdkHttpHeaders.headers()
to be used in the created HTTP request.String
host()
The host, exactly as it was configured withhost(String)
.SdkHttpRequest.Builder
host(String host)
Configure aSdkHttpRequest.host()
to be used in the created HTTP request.SdkHttpMethod
method()
The path, exactly as it was configured withmethod(SdkHttpMethod)
.SdkHttpRequest.Builder
method(SdkHttpMethod httpMethod)
Configure anSdkHttpRequest.method()
to be used in the created HTTP request.default int
numRawQueryParameters()
Integer
port()
The port, exactly as it was configured withport(Integer)
.SdkHttpRequest.Builder
port(Integer port)
Configure aSdkHttpRequest.port()
to be used in the created HTTP request.String
protocol()
The protocol, exactly as it was configured withprotocol(String)
.SdkHttpRequest.Builder
protocol(String protocol)
Configure aSdkHttpRequest.protocol()
to be used in the created HTTP request.default SdkHttpRequest.Builder
putHeader(String headerName, String headerValue)
Add a single header to be included in the created HTTP request.SdkHttpRequest.Builder
putHeader(String headerName, List<String> headerValues)
Add a single header with multiple values to be included in the created HTTP request.default SdkHttpRequest.Builder
putRawQueryParameter(String paramName, String paramValue)
Add a single un-encoded query parameter to be included in the created HTTP request.SdkHttpRequest.Builder
putRawQueryParameter(String paramName, List<String> paramValues)
Add a single un-encoded query parameter with multiple values to be included in the created HTTP request.Map<String,List<String>>
rawQueryParameters()
The query parameters, exactly as they were configured withrawQueryParameters(Map)
,putRawQueryParameter(String, String)
andputRawQueryParameter(String, List)
.SdkHttpRequest.Builder
rawQueryParameters(Map<String,List<String>> queryParameters)
Configure anSdkHttpRequest.rawQueryParameters()
to be used in the created HTTP request.SdkHttpRequest.Builder
removeHeader(String headerName)
Remove all values for the requested header from this builder.SdkHttpRequest.Builder
removeQueryParameter(String paramName)
Remove all values for the requested query parameter from this builder.default SdkHttpRequest.Builder
uri(URI uri)
Convenience method to set theprotocol()
,host()
,port()
,encodedPath()
and extracts query parameters from aURI
object.-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.http.SdkHttpHeaders
firstMatchingHeader, firstMatchingHeader, forEachHeader, matchingHeaders, numHeaders
-
-
-
-
Method Detail
-
uri
default SdkHttpRequest.Builder uri(URI uri)
Convenience method to set theprotocol()
,host()
,port()
,encodedPath()
and extracts query parameters from aURI
object.- Parameters:
uri
- URI containing protocol, host, port and path.- Returns:
- This builder for method chaining.
-
protocol
String protocol()
The protocol, exactly as it was configured withprotocol(String)
.
-
protocol
SdkHttpRequest.Builder protocol(String protocol)
Configure aSdkHttpRequest.protocol()
to be used in the created HTTP request. This is not validated until the http request is created.
-
host
String host()
The host, exactly as it was configured withhost(String)
.
-
host
SdkHttpRequest.Builder host(String host)
Configure aSdkHttpRequest.host()
to be used in the created HTTP request. This is not validated until the http request is created.
-
port
Integer port()
The port, exactly as it was configured withport(Integer)
.
-
port
SdkHttpRequest.Builder port(Integer port)
Configure aSdkHttpRequest.port()
to be used in the created HTTP request. This is not validated until the http request is created. In order to simplify mapping from aURI
, "-1" will be treated as "null" when the http request is created.
-
encodedPath
String encodedPath()
The path, exactly as it was configured withencodedPath(String)
.
-
encodedPath
SdkHttpRequest.Builder encodedPath(String path)
Configure anSdkHttpRequest.encodedPath()
to be used in the created HTTP request. This is not validated until the http request is created. This path MUST be URL encoded.Justification of requirements: The path must be encoded when it is configured, because there is no way for the HTTP implementation to distinguish a "/" that is part of a resource name that should be encoded as "%2F" from a "/" that is part of the actual path.
-
rawQueryParameters
Map<String,List<String>> rawQueryParameters()
The query parameters, exactly as they were configured withrawQueryParameters(Map)
,putRawQueryParameter(String, String)
andputRawQueryParameter(String, List)
.
-
putRawQueryParameter
default SdkHttpRequest.Builder putRawQueryParameter(String paramName, String paramValue)
Add a single un-encoded query parameter to be included in the created HTTP request.This completely OVERRIDES any values already configured with this parameter name in the builder.
- Parameters:
paramName
- The name of the query parameter to addparamValue
- The un-encoded value for the query parameter.
-
appendRawQueryParameter
SdkHttpRequest.Builder appendRawQueryParameter(String paramName, String paramValue)
Add a single un-encoded query parameter to be included in the created HTTP request.This will ADD the value to any existing values already configured with this parameter name in the builder.
- Parameters:
paramName
- The name of the query parameter to addparamValue
- The un-encoded value for the query parameter.
-
putRawQueryParameter
SdkHttpRequest.Builder putRawQueryParameter(String paramName, List<String> paramValues)
Add a single un-encoded query parameter with multiple values to be included in the created HTTP request.This completely OVERRIDES any values already configured with this parameter name in the builder.
- Parameters:
paramName
- The name of the query parameter to addparamValues
- The un-encoded values for the query parameter.
-
rawQueryParameters
SdkHttpRequest.Builder rawQueryParameters(Map<String,List<String>> queryParameters)
Configure anSdkHttpRequest.rawQueryParameters()
to be used in the created HTTP request. This is not validated until the http request is created. This overrides any values currently configured in the builder. The query parameters MUST NOT be URL encoded.Justification of requirements: The query parameters must not be encoded when they are configured because some HTTP implementations perform this encoding automatically.
-
removeQueryParameter
SdkHttpRequest.Builder removeQueryParameter(String paramName)
Remove all values for the requested query parameter from this builder.
-
clearQueryParameters
SdkHttpRequest.Builder clearQueryParameters()
Removes all query parameters from this builder.
-
forEachRawQueryParameter
default void forEachRawQueryParameter(BiConsumer<? super String,? super List<String>> consumer)
-
numRawQueryParameters
default int numRawQueryParameters()
-
method
SdkHttpMethod method()
The path, exactly as it was configured withmethod(SdkHttpMethod)
.
-
method
SdkHttpRequest.Builder method(SdkHttpMethod httpMethod)
Configure anSdkHttpRequest.method()
to be used in the created HTTP request. This is not validated until the http request is created.
-
headers
Map<String,List<String>> headers()
The query parameters, exactly as they were configured withheaders(Map)
,putHeader(String, String)
andputHeader(String, List)
.- Specified by:
headers
in interfaceSdkHttpHeaders
- Returns:
- An unmodifiable map of all headers in this message.
-
putHeader
default SdkHttpRequest.Builder putHeader(String headerName, String headerValue)
Add a single header to be included in the created HTTP request.This completely OVERRIDES any values already configured with this header name in the builder.
- Parameters:
headerName
- The name of the header to add (eg. "Host")headerValue
- The value for the header
-
putHeader
SdkHttpRequest.Builder putHeader(String headerName, List<String> headerValues)
Add a single header with multiple values to be included in the created HTTP request.This completely OVERRIDES any values already configured with this header name in the builder.
- Parameters:
headerName
- The name of the header to addheaderValues
- The values for the header
-
appendHeader
SdkHttpRequest.Builder appendHeader(String headerName, String headerValue)
Add a single header to be included in the created HTTP request.This will ADD the value to any existing values already configured with this header name in the builder.
- Parameters:
headerName
- The name of the header to addheaderValue
- The value for the header
-
headers
SdkHttpRequest.Builder headers(Map<String,List<String>> headers)
Configure anSdkHttpHeaders.headers()
to be used in the created HTTP request. This is not validated until the http request is created. This overrides any values currently configured in the builder.
-
removeHeader
SdkHttpRequest.Builder removeHeader(String headerName)
Remove all values for the requested header from this builder.
-
clearHeaders
SdkHttpRequest.Builder clearHeaders()
Removes all headers from this builder.
-
-