@Immutable public interface SdkHttpRequest extends SdkHttpHeaders, ToCopyableBuilder<SdkHttpRequest.Builder,SdkHttpRequest>
SdkHttpFullRequest
should be used when access to a
request body stream is required.Modifier and Type | Interface and Description |
---|---|
static interface |
SdkHttpRequest.Builder
A mutable builder for
SdkHttpFullRequest . |
Modifier and Type | Method and Description |
---|---|
static SdkHttpRequest.Builder |
builder() |
String |
encodedPath()
Returns the URL-encoded path that should be used in the HTTP request.
|
default URI |
getUri()
Convert this HTTP request's protocol, host, port, path and query string into a properly-encoded URI string that matches the
URI string used for AWS request signing.
|
String |
host()
Returns the host that should be communicated with.
|
SdkHttpMethod |
method()
Returns the HTTP method (GET, POST, etc) to use when sending this request.
|
int |
port()
The port that should be used for HTTP communication.
|
String |
protocol()
Returns the protocol that should be used for HTTP communication.
|
Map<String,List<String>> |
rawQueryParameters()
Returns a map of all non-URL encoded parameters in this request.
|
firstMatchingHeader, headers
copy, toBuilder
static SdkHttpRequest.Builder builder()
DefaultSdkHttpFullRequest
.String protocol()
This will always be "https" or "http" (lowercase).
String host()
This will never be null.
int port()
Important Note: AWS signing DOES NOT include the port when the request is signed if the default port for the protocol is
being used. When sending requests via http over port 80 or via https over port 443, the URI or host header MUST NOT include
the port or a signature error will be raised from the service for signed requests. HTTP plugin implementers are encouraged
to use the getUri()
method for generating the URI to use for communicating with AWS to ensure the URI used in the
request matches the URI used during signing.
String encodedPath()
If a path is configured, the path will always start with '/' and may or may not end with '/', depending on what the service might expect. If a path is not configured, this will always return empty-string (ie. ""). Note that '/' is also a valid path.
Map<String,List<String>> rawQueryParameters()
SdkHttpUtils.encodeQueryParameters(Map)
to encode parameters into map-form, or
SdkHttpUtils.encodeAndFlattenQueryParameters(Map)
to encode the parameters into uri-formatted string form.
This will never be null. If there are no parameters an empty map is returned.
default URI getUri()
The URI's port will be missing (-1) when the port()
is the default port for the protocol()
. (80 for
http and 443 for https). This is to reflect the fact that request signature does not include the port.
SdkHttpMethod method()
This will never be null.
Copyright © 2021. All rights reserved.