public abstract class BodySenderRequestBuilderBaseDefault<T extends BodySenderRequestBuilderBase<?>> extends HttpRequestBuilderBase<T> implements BodySenderRequestBuilderBase<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BodySenderRequestBuilderBaseDefault.BodyType |
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
BodySenderRequestBuilderBaseDefault(String url,
CookieFactory cookieFactory,
HttpResponseFactory spincastHttpResponseFactory,
JsonManager jsonManager,
XmlManager xmlManager,
SpincastHttpClientUtils spincastHttpClientUtils,
SpincastHttpClientConfig spincastHttpClientConfig)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
T |
addFileToUploadBody(String path,
boolean isClasspathPath,
String name)
Adds a file to upload body.
|
T |
addFileToUploadBody(String path,
String name)
Adds a file to upload body.
|
T |
addFormBodyFieldValue(String name,
String value)
Adds a value to a Form field.
|
protected List<org.spincast.shaded.org.apache.http.NameValuePair> |
convertToNameValuePair(Map<String,List<String>> params) |
protected org.spincast.shaded.org.apache.http.client.methods.HttpRequestBase |
createMethodSpecificHttpRequest(String url)
Creates the HttpRequestBase depending on the HTTP method.
|
protected BodySenderRequestBuilderBaseDefault.BodyType |
getBodyType() |
protected List<FileToUpload> |
getFileToUploads() |
protected String |
getFormBodyEncoding() |
protected Map<String,List<String>> |
getFormBodyFields() |
protected abstract org.spincast.shaded.org.apache.http.client.methods.HttpEntityEnclosingRequestBase |
getHttpEntityEnclosingRequestBase(String url) |
protected JsonManager |
getJsonManager() |
protected org.spincast.shaded.org.apache.http.HttpEntity |
getStandardBody() |
protected String |
getStringBodyEncoding() |
protected XmlManager |
getXmlManager() |
T |
setBody(org.spincast.shaded.org.apache.http.HttpEntity body)
Sets an custom
HttpEntity body to be sent. |
T |
setFormBodyField(String fieldName,
List<String> values)
Sets a field on the form body, with its values.
|
T |
setFormBodyFields(Map<String,List<String>> formFields)
Sets fields on the form body.
|
T |
setJsonStringBody(Object object)
Sets a
Json body to be sent. |
T |
setStringBody(String stringBody,
String contentType)
Sets a String body.
|
T |
setXmlStringBody(Object object)
Sets a
XML body to be sent. |
addHeaderValue, addHeaderValues, addHTMLAcceptHeader, addJsonAcceptHeader, addPlainTextAcceptHeader, addXMLAcceptHeader, convertToApacheCookie, createHttpClient, createHttpClientBuilder, disableSslCertificateErrors, getCookieEncoding, getCookieFactory, getCookieStore, getHeaders, getHttpAuthPassword, getHttpAuthUsername, getHttpClient, getHttpClientBuilder, getHttpRequestExecutor, getRequestConfig, getSpincastHttpClientConfig, getSpincastHttpClientUtils, getSpincastHttpResponseFactory, getUrl, isDisableSslCertificateErrors, send, sendGetRawResponse, setCookie, setCookie, setCookie, setCookies, setCookieStore, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddHeaderValue, addHeaderValues, addHTMLAcceptHeader, addJsonAcceptHeader, addPlainTextAcceptHeader, addXMLAcceptHeader, disableSslCertificateErrors, send, setCookie, setCookie, setCookie, setCookies, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfigpublic BodySenderRequestBuilderBaseDefault(String url, CookieFactory cookieFactory, HttpResponseFactory spincastHttpResponseFactory, JsonManager jsonManager, XmlManager xmlManager, SpincastHttpClientUtils spincastHttpClientUtils, SpincastHttpClientConfig spincastHttpClientConfig)
protected String getStringBodyEncoding()
protected String getFormBodyEncoding()
protected BodySenderRequestBuilderBaseDefault.BodyType getBodyType()
protected org.spincast.shaded.org.apache.http.HttpEntity getStandardBody()
protected JsonManager getJsonManager()
protected XmlManager getXmlManager()
protected List<FileToUpload> getFileToUploads()
public T addFormBodyFieldValue(String name, String value)
BodySenderRequestBuilderBaseKeeps the existing values of the field.
Only one type of body can be set amongs:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
addFormBodyFieldValue in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T setFormBodyField(String fieldName, List<String> values)
BodySenderRequestBuilderBaseOverwrites an existing field of the same name, but keeps the other ones.
Only one type of body can be set amongs:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
setFormBodyField in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T setFormBodyFields(Map<String,List<String>> formFields)
BodySenderRequestBuilderBaseA 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:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
setFormBodyFields in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T setStringBody(String stringBody, String contentType)
BodySenderRequestBuilderBaseOnly one type of body can be set amongs:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
setStringBody in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T setJsonStringBody(Object object)
BodySenderRequestBuilderBaseJson body to be sent.
The specified object will be converted to a Json's
String representation and sent using the application/json
Content-Type.
Only one type of body can be set amongs:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
setJsonStringBody in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T setXmlStringBody(Object object)
BodySenderRequestBuilderBaseXML body to be sent.
The specified object will be converted to XML
and sent using the application/xml
Content-Type.
Only one type of body can be set amongs:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
setXmlStringBody in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T setBody(org.spincast.shaded.org.apache.http.HttpEntity body)
BodySenderRequestBuilderBaseHttpEntity body to be sent.
Only one type of body can be set amongs:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
setBody in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>public T addFileToUploadBody(String path, String name)
BodySenderRequestBuilderBaseMore 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:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
addFileToUploadBody in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>path - the path to the file to upload,
on the file system.name - the name to use for the uploaded file.public T addFileToUploadBody(String path, boolean isClasspathPath, String name)
BodySenderRequestBuilderBaseMore 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:
HttpEntity body
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
addFileToUploadBody in interface BodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>path - the path to the file to uploadisClasspathPath - if true, 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.protected List<org.spincast.shaded.org.apache.http.NameValuePair> convertToNameValuePair(Map<String,List<String>> params)
protected org.spincast.shaded.org.apache.http.client.methods.HttpRequestBase createMethodSpecificHttpRequest(String url)
HttpRequestBuilderBasecreateMethodSpecificHttpRequest in class HttpRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>protected abstract org.spincast.shaded.org.apache.http.client.methods.HttpEntityEnclosingRequestBase getHttpEntityEnclosingRequestBase(String url)
Copyright © 2018. All rights reserved.