Constructor and Description |
---|
MultiPartConfig()
Create a new MultiPartConfig with default control name equal to and
default file name equal to and default subtype and
default boundary
null (which means it'll be automatically generated) and default charset US-ASCII. |
Modifier and Type | Method and Description |
---|---|
MultiPartConfig |
and()
Syntactic sugar.
|
String |
defaultBoundary()
Get the default multipart boundary to use when sending multi-part data.
|
MultiPartConfig |
defaultBoundary(String defaultBoundary)
Specify an explicit default multipart boundary to use when sending multi-part data.
|
String |
defaultCharset()
Get the default multipart charset to use when sending multi-part data.
|
MultiPartConfig |
defaultCharset(Charset defaultCharset)
Specify a default charset to use for multi-parts (default is US-ASCII).
|
MultiPartConfig |
defaultCharset(String defaultCharset)
Specify a default charset to use for multi-parts (default is US-ASCII).
|
String |
defaultControlName() |
MultiPartConfig |
defaultControlName(String defaultControlName)
Specify the default control name to use if not defined explicitly in multi-part request.
|
String |
defaultFileName() |
MultiPartConfig |
defaultFileName(String defaultFileName)
Specify the default filename to use if not defined explicitly in multi-part request.
|
String |
defaultSubtype() |
MultiPartConfig |
defaultSubtype(String defaultSubtype)
Specify the default subtype to use if not defined explicitly in when making the multi-part request.
|
MultiPartConfig |
emptyDefaultFileName()
Specify default filename to be empty if not defined explicitly in multi-part request.
|
boolean |
isUserConfigured() |
static MultiPartConfig |
multiPartConfig() |
MultiPartConfig |
with()
Syntactic sugar.
|
public MultiPartConfig()
null
(which means it'll be automatically generated) and default charset US-ASCII.public MultiPartConfig defaultControlName(String defaultControlName)
Default is
defaultControlName
- The control name to useMultiPartConfig
public MultiPartConfig defaultFileName(String defaultFileName)
Default is
defaultFileName
- The file name to useMultiPartConfig
public MultiPartConfig defaultSubtype(String defaultSubtype)
Default is
defaultSubtype
- The default subtype to use in multipart requests. Default is .MultiPartConfig
public MultiPartConfig emptyDefaultFileName()
This is the same as calling defaultFileName(String)
with null
.
MultiPartConfig
public String defaultControlName()
public String defaultFileName()
public String defaultSubtype()
public MultiPartConfig defaultBoundary(String defaultBoundary)
defaultBoundary
- The boundary to setpublic MultiPartConfig defaultCharset(String defaultCharset)
NOTE: This setting is only taken into account if HttpClientConfig.httpMultipartMode(HttpMultipartMode)
is set to
something other than HttpMultipartMode.STRICT
(which is the default). So if you want this setting to apply you also need to
explicitly change the multipart mode, for example:
given(). config(RestAssuredConfig.config() .httpClient(HttpClientConfig.httpClientConfig().httpMultipartMode(BROWSER_COMPATIBLE)) .multiPartConfig(multiPartConfig().defaultCharset("UTF-8"))). when(). post("/x"). ..
defaultCharset
- The default charset to use.public MultiPartConfig defaultCharset(Charset defaultCharset)
NOTE: This setting is only taken into account if HttpClientConfig.httpMultipartMode(HttpMultipartMode)
is set to
something other than HttpMultipartMode.STRICT
(which is the default). So if you want this setting to apply you also need to
explicitly change the multipart mode, for example:
given(). config(RestAssuredConfig.config() .httpClient(HttpClientConfig.httpClientConfig().httpMultipartMode(BROWSER_COMPATIBLE)) .multiPartConfig(multiPartConfig().defaultCharset("UTF-8"))). when(). post("/x"). ..
defaultCharset
- The default charset to use.public String defaultBoundary()
public String defaultCharset()
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.public static MultiPartConfig multiPartConfig()
public MultiPartConfig and()
public MultiPartConfig with()
Copyright © 2010–2019. All rights reserved.