Modifier and Type | Class and Description |
---|---|
static class |
DecoderConfig.ContentDecoder
Predefined content encoders in REST Assured.
|
Constructor and Description |
---|
DecoderConfig()
Configure the decoder config to use the default charset as specified by
Charset.defaultCharset() for content decoding. |
DecoderConfig(DecoderConfig.ContentDecoder contentDecoder,
DecoderConfig.ContentDecoder... additionalContentDecoders)
Configure the decoder config to use
Charset.defaultCharset() for content decoding. |
DecoderConfig(String defaultContentCharset)
Configure the decoder config to use supplied
defaultContentCharset for content decoding if a charset is not specified in the response. |
Modifier and Type | Method and Description |
---|---|
DecoderConfig |
and()
Syntactic sugar.
|
List<DecoderConfig.ContentDecoder> |
contentDecoders() |
DecoderConfig |
contentDecoders(DecoderConfig.ContentDecoder contentDecoder,
DecoderConfig.ContentDecoder... additionalContentDecoders)
Specify the content decoders that will be presented to the server when making a request (using the
Accept-Encoding header). |
static DecoderConfig |
decoderConfig() |
DecoderConfig |
defaultCharsetForContentType(Charset charset,
ContentType contentType)
Specify the default charset to use for the specific content-type if it's not specified in the content-type header explicitly
|
DecoderConfig |
defaultCharsetForContentType(Charset charset,
String contentType)
Specify the default charset to use for the specific content-type if it's not specified in the content-type header explicitly
|
String |
defaultCharsetForContentType(ContentType contentType) |
String |
defaultCharsetForContentType(String contentType) |
DecoderConfig |
defaultCharsetForContentType(String charset,
ContentType contentType)
Specify the default charset to use for the specific content-type if it's not specified in the content-type header explicitly
|
DecoderConfig |
defaultCharsetForContentType(String charset,
String contentType)
Specify the default charset to use for the specific content-type if it's not specified in the content-type header explicitly
|
String |
defaultContentCharset() |
DecoderConfig |
defaultContentCharset(Charset charset)
Specify the default charset of the content in the response that's assumed if no charset is explicitly specified in the response.
|
DecoderConfig |
defaultContentCharset(String charset)
Specify the default charset of the content in the response that's assumed if no charset is explicitly specified in the response.
|
boolean |
hasDefaultCharsetForContentType(String contentType) |
boolean |
isUserConfigured() |
DecoderConfig |
noContentDecoders()
Specify that no content decoders should be used by REST Assured.
|
boolean |
shouldUseNoWrapForInflateDecoding() |
DecoderConfig |
useNoWrapForInflateDecoding(boolean nowrap)
If the parameter 'nowrap' is true then the ZLIB header and checksum fields will not be used.
|
DecoderConfig |
with()
Syntactic sugar.
|
public DecoderConfig()
Charset.defaultCharset()
for content decoding.public DecoderConfig(String defaultContentCharset)
defaultContentCharset
for content decoding if a charset is not specified in the response.defaultContentCharset
- The charset to use if not specifically specified in the response.public DecoderConfig(DecoderConfig.ContentDecoder contentDecoder, DecoderConfig.ContentDecoder... additionalContentDecoders)
Charset.defaultCharset()
for content decoding.
Also specify the content decoders that will be presented to the server when making a request (using the Accept-Encoding
header).
If the server supports any of these encodings then REST Assured will automatically perform decoding of the response accordingly.
By default DecoderConfig.ContentDecoder.GZIP
and DecoderConfig.ContentDecoder.DEFLATE
are used.
contentDecoder
- The first content decoderadditionalContentDecoders
- Optional additional content decoderspublic DecoderConfig defaultCharsetForContentType(String charset, String contentType)
charset
- The charset to use as default (unless specified explicitly)contentType
- The content-typeDecoderConfig
public DecoderConfig defaultCharsetForContentType(Charset charset, String contentType)
charset
- The charset to use as default (unless specified explicitly)contentType
- The content-typeDecoderConfig
public DecoderConfig defaultCharsetForContentType(Charset charset, ContentType contentType)
charset
- The charset to use as default (unless specified explicitly)contentType
- The content-typeDecoderConfig
public DecoderConfig defaultCharsetForContentType(String charset, ContentType contentType)
charset
- The charset to use as default (unless specified explicitly)contentType
- The content-typeDecoderConfig
public String defaultCharsetForContentType(String contentType)
defaultContentCharset()
.public String defaultCharsetForContentType(ContentType contentType)
defaultContentCharset()
.public boolean hasDefaultCharsetForContentType(String contentType)
defaultContentCharset()
.public String defaultContentCharset()
public List<DecoderConfig.ContentDecoder> contentDecoders()
public DecoderConfig useNoWrapForInflateDecoding(boolean nowrap)
true
is required when communicating with servers not using RFC 1950 (such as PHP which uses RFC 1951).
See stackoverflow for more details.
Default is .nowrap
- if true then support GZIP compatible compressionpublic boolean shouldUseNoWrapForInflateDecoding()
true
if no wrap should be used for inflate encoded streams.useNoWrapForInflateDecoding(boolean)
public DecoderConfig defaultContentCharset(String charset)
charset
- The expected charsetpublic DecoderConfig defaultContentCharset(Charset charset)
charset
- The expected charsetpublic DecoderConfig contentDecoders(DecoderConfig.ContentDecoder contentDecoder, DecoderConfig.ContentDecoder... additionalContentDecoders)
Accept-Encoding
header).
If the server supports any of these encodings then REST Assured will automatically perform decoding of the response accordingly.
By default DecoderConfig.ContentDecoder.GZIP
and DecoderConfig.ContentDecoder.DEFLATE
are used.
contentDecoder
- The first content decoderadditionalContentDecoders
- Optional additional content decoderspublic DecoderConfig noContentDecoders()
contentDecoders(DecoderConfig.ContentDecoder, DecoderConfig.ContentDecoder...)
public static DecoderConfig decoderConfig()
public DecoderConfig and()
public DecoderConfig with()
public boolean isUserConfigured()
isUserConfigured
in interface Config
true
if this config instance has been explicitly configured by the user, false
if it has the default values.Copyright © 2010–2024. All rights reserved.