public class EncoderConfig extends Object
| Constructor and Description |
|---|
EncoderConfig()
Configure the encoder config to use "ISO-8859-1" for content encoding and
UTF-8. |
EncoderConfig(String defaultContentCharset,
String defaultQueryParameterCharset) |
| Modifier and Type | Method and Description |
|---|---|
EncoderConfig |
and()
Syntactic sugar.
|
EncoderConfig |
appendDefaultContentCharsetToStreamingContentTypeIfUndefined(boolean shouldAddDefaultContentCharsetToContentTypeIfMissing)
Tells whether REST Assured should automatically append the content charset to the content-type header if not defined explicitly.
|
String |
defaultContentCharset() |
EncoderConfig |
defaultContentCharset(String charset) |
String |
defaultQueryParameterCharset() |
EncoderConfig |
defaultQueryParameterCharset(String charset) |
static EncoderConfig |
encoderConfig() |
boolean |
shouldAppendDefaultContentCharsetToStreamingContentTypeIfUndefined()
Tells whether REST Assured should automatically append the content charset to the content-type header if not defined explicitly.
|
public EncoderConfig()
UTF-8.
for query parameter encoding.
The reason for choosing UTF-8 as default for query parameters even though US-ASCII is standard according to the URI Syntax specification is that it's nowadays recommended by w3 to use UTF-8. Different web servers seem to take different approaches though, for example Jetty uses UTF-8 as default but Tomcat uses US-ASCII. Since REST Assured is a test framework first and Jetty is more popular for testing REST Assured uses UTF-8.
public String defaultContentCharset()
public String defaultQueryParameterCharset()
public EncoderConfig defaultContentCharset(String charset)
public EncoderConfig defaultQueryParameterCharset(String charset)
public EncoderConfig appendDefaultContentCharsetToStreamingContentTypeIfUndefined(boolean shouldAddDefaultContentCharsetToContentTypeIfMissing)
Note that this is only applicable for streaming data, such as byte arrays and input streams and does not affect multipart form data.
Default is true.
shouldAddDefaultContentCharsetToContentTypeIfMissing - Whether REST Assured should automatically append the content charset to the content-type header if not defined explicitly.EncoderConfig instancepublic boolean shouldAppendDefaultContentCharsetToStreamingContentTypeIfUndefined()
Note that this is only applicable for streaming data, such as byte arrays and input streams and does not affect multipart form data.
true if REST Assured should automatically append the content charset to the content-type header if not defined explicitly.public static EncoderConfig encoderConfig()
public EncoderConfig and()
Copyright © 2010–2014. All rights reserved.