public interface HttpRequestWithBody extends HttpRequest<HttpRequestWithBody>
| Modifier and Type | Method and Description |
|---|---|
RequestBodyEntity |
body(byte[] body)
Set a byte array as the body of the request
|
RequestBodyEntity |
body(JSONElement body)
Set JSON on the body
|
RequestBodyEntity |
body(JsonNode body)
Set JSON on the body
|
RequestBodyEntity |
body(Object body)
Set a Object as the body of the request.
|
RequestBodyEntity |
body(String body)
Set a String as the body of the request
|
HttpRequestWithBody |
charset(Charset charset)
Set the Charset encoding for the Content-Type.
|
MultipartBody |
field(String name,
Collection<?> value)
Sets multiple field params on the body each with the same name.
|
MultipartBody |
field(String name,
File file)
Sets a File on the body.
|
MultipartBody |
field(String name,
File file,
String contentType)
Sets a File on the body with a specified content-type.
|
MultipartBody |
field(String name,
InputStream stream,
ContentType contentType,
String fileName)
Sets a File on the body from a raw InputStream requires a specified content-type and file name.
|
MultipartBody |
field(String name,
InputStream stream,
String fileName)
Sets a File on the body from a raw InputStream requires a file name.
|
MultipartBody |
field(String name,
Object value)
Sets a field param on the body.
|
MultipartBody |
field(String name,
Object value,
String contentType)
Sets a field param on the body with a specified content-type.
|
MultipartBody |
fields(Map<String,Object> parameters)
Sets multiple field params on the body from a map of key/value pairs.
|
Charset |
getCharset()
get the current default charset
|
MultipartBody |
multiPartContent()
Forces the request to send as multipart even if all params are simple
|
default HttpRequestWithBody |
noCharset()
Removes any Charset for the Content-Type for when servers cannot process it.
|
accept, asBytes, asBytesAsync, asBytesAsync, asEmpty, asEmptyAsync, asEmptyAsync, asFile, asFileAsync, asFileAsync, asJson, asJsonAsync, asJsonAsync, asObject, asObject, asObject, asObjectAsync, asObjectAsync, asObjectAsync, asObjectAsync, asObjectAsync, asPaged, asString, asStringAsync, asStringAsync, basicAuth, connectTimeout, cookie, cookie, cookie, downloadMonitor, getBody, getConnectTimeout, getCreationTime, getHeaders, getHttpMethod, getProxy, getSocketTimeout, getUrl, header, headerReplace, headers, proxy, queryString, queryString, queryString, responseEncoding, routeParam, routeParam, socketTimeout, thenConsume, thenConsumeAsync, toSummary, withObjectMapperMultipartBody multiPartContent()
MultipartBody field(String name, Object value)
name - the name of the fieldvalue - a valuesMultipartBody field(String name, Collection<?> value)
name - the name of the fieldvalue - a Collection of valuesMultipartBody field(String name, Object value, String contentType)
name - the name of the fieldvalue - the objectcontentType - contentType (i.e. application/xml)MultipartBody fields(Map<String,Object> parameters)
parameters - the map of field paramsMultipartBody field(String name, File file)
name - the name of the file fieldfile - the fileMultipartBody field(String name, File file, String contentType)
name - the name of the file fieldfile - the filecontentType - contentType (i.e. image/png)MultipartBody field(String name, InputStream stream, String fileName)
name - the name of the file fieldstream - the inputStreamfileName - the name for the fileMultipartBody field(String name, InputStream stream, ContentType contentType, String fileName)
name - the name of the file fieldstream - the inputStreamcontentType - contentType (i.e. image/png)fileName - the name for the fileHttpRequestWithBody charset(Charset charset)
charset - the charsetdefault HttpRequestWithBody noCharset()
RequestBodyEntity body(String body)
body - the StringRequestBodyEntity body(Object body)
body - the ObjectRequestBodyEntity body(byte[] body)
body - the byte[]RequestBodyEntity body(JsonNode body)
body - the JsonNodeRequestBodyEntity body(JSONElement body)
body - the JSONElementCharset getCharset()
Copyright © 2020. All rights reserved.