Interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
- All Superinterfaces:
HttpRequestBuilder<T>
- All Known Subinterfaces:
PatchRequestBuilder
,PostRequestBuilder
,PutRequestBuilder
- All Known Implementing Classes:
BodySenderRequestBuilderBaseDefault
,PatchRequestBuilderDefault
,PostRequestBuilderDefault
,PutRequestBuilderDefault
-
Method Summary
Modifier and TypeMethodDescriptionaddFileToUploadBody
(String path, boolean isClasspathPath, String name) Adds a file to upload body.addFileToUploadBody
(String path, String name) Adds a file to upload body.addFormBodyFieldValue
(String fieldName, String value) Adds a value to a Form field.setBody
(org.spincast.shaded.org.apache.http.HttpEntity entity) Sets an customHttpEntity
body to be sent.setFormBodyField
(String fieldName, List<String> values) Sets a field on the form body, with its values.setFormBodyFields
(Map<String, List<String>> params) Sets fields on the form body.setJsonStringBody
(Object object) Sets aJson
body to be sent.setStringBody
(String entity, String contentType) Sets a String body.setXmlStringBody
(Object object) Sets aXML
body to be sent.Methods inherited from interface org.spincast.plugins.httpclient.HttpRequestBuilder
addHeaderValue, addHeaderValues, addHTMLAcceptHeader, addJsonAcceptHeader, addPlainTextAcceptHeader, addXMLAcceptHeader, disableRedirectHandling, disableSslCertificateErrors, send, setCookie, setCookie, setCookie, setCookies, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfig
-
Method Details
-
setBody
Sets an customHttpEntity
body to be sent.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
setFormBodyFields
Sets fields on the form body.A form body can contain more than one fields and each field may have multiple values.
Overwrites any existing Form fields.
Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
setFormBodyField
Sets a field on the form body, with its values. Each form field may have multiple values.Overwrites an existing field of the same name, but keeps the other ones.
Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
addFormBodyFieldValue
Adds a value to a Form field.Keeps the existing values of the field.
Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
setStringBody
Sets a String body.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
setJsonStringBody
Sets aJson
body to be sent.The specified object will be converted to a
Json
's String representation and sent using theapplication/json
Content-Type.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
setXmlStringBody
Sets aXML
body to be sent.The specified object will be converted to
XML
and sent using theapplication/xml
Content-Type.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
-
addFileToUploadBody
Adds a file to upload body.More than one file can be uploaded at one time. The specified file is added to the existing ones.
Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Parameters:
path
- the path to the file to upload, on the file system.name
- the name to use for the uploaded file.
-
addFileToUploadBody
Adds a file to upload body.More than one file can be uploaded at one time. The specified file is added to the existing ones.
Only one type of body can be set amongs:
Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntity
body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Parameters:
path
- the path to the file to uploadisClasspathPath
- iftrue
, the path to the file to upload is on the classpath, otherwise, it's on the file system.name
- the name to use for the uploaded file.
-