public static interface SdkHttpResponse.Builder extends CopyableBuilder<SdkHttpResponse.Builder,SdkHttpResponse>
DefaultSdkHttpFullResponse
.Modifier and Type | Method and Description |
---|---|
SdkHttpResponse.Builder |
appendHeader(String headerName,
String headerValue)
Add a single header to be included in the created HTTP request.
|
SdkHttpResponse.Builder |
clearHeaders()
Removes all headers from this builder.
|
default Optional<String> |
firstMatchingHeader(String header)
Perform a case-insensitive search for a particular header in this request, returning the first matching header, if one
is found.
|
Map<String,List<String>> |
headers()
The query parameters, exactly as they were configured with
headers(Map) ,
putHeader(String, String) and putHeader(String, List) . |
SdkHttpResponse.Builder |
headers(Map<String,List<String>> headers)
Configure an
SdkHttpHeaders.headers() to be used in the created HTTP response. |
SdkHttpResponse.Builder |
putHeader(String headerName,
List<String> headerValues)
Add a single header with multiple values to be included in the created HTTP response.
|
default SdkHttpResponse.Builder |
putHeader(String headerName,
String headerValue)
Add a single header to be included in the created HTTP response.
|
SdkHttpResponse.Builder |
removeHeader(String headerName)
Remove all values for the requested header from this builder.
|
int |
statusCode()
The status text, exactly as it was configured with
statusCode(int) . |
SdkHttpResponse.Builder |
statusCode(int statusCode)
Configure an
SdkHttpResponse.statusCode() to be used in the created HTTP response. |
String |
statusText()
The status text, exactly as it was configured with
statusText(String) . |
SdkHttpResponse.Builder |
statusText(String statusText)
Configure an
SdkHttpResponse.statusText() to be used in the created HTTP response. |
copy
applyMutation, build
String statusText()
statusText(String)
.SdkHttpResponse.Builder statusText(String statusText)
SdkHttpResponse.statusText()
to be used in the created HTTP response. This is not validated
until the http response is created.int statusCode()
statusCode(int)
.SdkHttpResponse.Builder statusCode(int statusCode)
SdkHttpResponse.statusCode()
to be used in the created HTTP response. This is not validated
until the http response is created.Map<String,List<String>> headers()
headers(Map)
,
putHeader(String, String)
and putHeader(String, List)
.default Optional<String> firstMatchingHeader(String header)
This is useful for headers like 'Content-Type' or 'Content-Length' of which there is expected to be only one value present.
This is equivalent to invoking SdkHttpUtils.firstMatchingHeader(Map, String)
header
- The header to search for (case insensitively).default SdkHttpResponse.Builder putHeader(String headerName, String headerValue)
This completely OVERRIDES any values already configured with this header name in the builder.
headerName
- The name of the header to add (eg. "Host")headerValue
- The value for the headerSdkHttpResponse.Builder putHeader(String headerName, List<String> headerValues)
This completely OVERRIDES any values already configured with this header name in the builder.
headerName
- The name of the header to addheaderValues
- The values for the headerSdkHttpResponse.Builder appendHeader(String headerName, String headerValue)
This will ADD the value to any existing values already configured with this header name in the builder.
headerName
- The name of the header to addheaderValue
- The value for the headerSdkHttpResponse.Builder headers(Map<String,List<String>> headers)
SdkHttpHeaders.headers()
to be used in the created HTTP response. This is not validated
until the http response is created. This overrides any values currently configured in the builder.SdkHttpResponse.Builder removeHeader(String headerName)
SdkHttpResponse.Builder clearHeaders()
Copyright © 2019. All rights reserved.