public abstract class EntitySenderRequestBuilderBaseDefault<T extends EntitySenderRequestBuilderBase<?>> extends HttpRequestBuilderBase<T> implements EntitySenderRequestBuilderBase<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
EntitySenderRequestBuilderBaseDefault.EntityType |
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
EntitySenderRequestBuilderBaseDefault(String url,
CookieFactory cookieFactory,
HttpResponseFactory spincastHttpResponseFactory,
JsonManager jsonManager,
XmlManager xmlManager,
SpincastHttpClientUtils spincastHttpClientUtils,
SpincastHttpClientConfig spincastHttpClientConfig)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
T |
addEntityFileUpload(String path,
boolean isClasspathPath,
String name)
Adds a file to upload.
|
T |
addEntityFileUpload(String path,
String name)
Adds a file to upload.
|
T |
addEntityFormDataValue(String name,
String value)
Adds a value to a Form data.
|
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 org.spincast.shaded.org.apache.http.HttpEntity |
getEntity() |
protected List<FileToUpload> |
getEntityFileUploads() |
protected Map<String,List<String>> |
getEntityFormDatas() |
protected String |
getEntityFormDatasEncoding() |
protected String |
getEntityStringEncoding() |
protected EntitySenderRequestBuilderBaseDefault.EntityType |
getEntityType() |
protected abstract org.spincast.shaded.org.apache.http.client.methods.HttpEntityEnclosingRequestBase |
getHttpEntityEnclosingRequestBase(String url) |
protected JsonManager |
getJsonManager() |
protected XmlManager |
getXmlManager() |
T |
setEntity(org.spincast.shaded.org.apache.http.HttpEntity entity)
Sets an custom
HttpEntity entity to be sent. |
T |
setEntityFormData(String name,
List<String> values)
Sets a Form data entity.
|
T |
setEntityFormDatas(Map<String,List<String>> formDatas)
Sets the Form datas entity.
|
T |
setEntityJson(Object object)
Sets a
Json entity to be sent. |
T |
setEntityString(String entityString,
String contentType)
Sets a String entity.
|
T |
setEntityXml(Object object)
Sets a
XML entity to be sent. |
addCookie, addCookie, addCookies, 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, setCookieStore, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCookie, addCookie, addCookies, addHeaderValue, addHeaderValues, addHTMLAcceptHeader, addJsonAcceptHeader, addPlainTextAcceptHeader, addXMLAcceptHeader, disableSslCertificateErrors, send, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfigpublic EntitySenderRequestBuilderBaseDefault(String url, CookieFactory cookieFactory, HttpResponseFactory spincastHttpResponseFactory, JsonManager jsonManager, XmlManager xmlManager, SpincastHttpClientUtils spincastHttpClientUtils, SpincastHttpClientConfig spincastHttpClientConfig)
protected String getEntityStringEncoding()
protected String getEntityFormDatasEncoding()
protected EntitySenderRequestBuilderBaseDefault.EntityType getEntityType()
protected org.spincast.shaded.org.apache.http.HttpEntity getEntity()
protected JsonManager getJsonManager()
protected XmlManager getXmlManager()
protected List<FileToUpload> getEntityFileUploads()
public T addEntityFormDataValue(String name, String value)
EntitySenderRequestBuilderBaseHttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.addEntityFormDataValue in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T setEntityFormData(String name, List<String> values)
EntitySenderRequestBuilderBaseHttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.setEntityFormData in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T setEntityFormDatas(Map<String,List<String>> formDatas)
EntitySenderRequestBuilderBaseHttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.setEntityFormDatas in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T setEntityString(String entityString, String contentType)
EntitySenderRequestBuilderBaseHttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.setEntityString in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T setEntityJson(Object object)
EntitySenderRequestBuilderBaseJson entity to be sent.
The object will be converted to a Json's
String representation and sent using the application/json
Content-Type.
Only one type of entity can be set amongs:
- Form datas entity
- String entity
- File upload
- Custom HttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.setEntityJson in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T setEntityXml(Object object)
EntitySenderRequestBuilderBaseXML entity to be sent.
The object will be converted to a XML
and sent using the application/xml
Content-Type.
Only one type of entity can be set amongs:
- Form datas entity
- String entity
- File upload
- Custom HttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.setEntityXml in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T setEntity(org.spincast.shaded.org.apache.http.HttpEntity entity)
EntitySenderRequestBuilderBaseHttpEntity entity to be sent.
Only one type of entity can be set amongs:
- Form datas entity
- String entity
- File upload
- custom HttpEntity
When you set or add an entity of a new type, the
existing entity is overwritten.setEntity in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>public T addEntityFileUpload(String path, String name)
EntitySenderRequestBuilderBaseHttpEntityaddEntityFileUpload in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>path - the path to the file to upload,
on the file systemname - the name to use for the uploaded file.public T addEntityFileUpload(String path, boolean isClasspathPath, String name)
EntitySenderRequestBuilderBaseHttpEntityaddEntityFileUpload in interface EntitySenderRequestBuilderBase<T extends EntitySenderRequestBuilderBase<?>>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 EntitySenderRequestBuilderBase<?>>protected abstract org.spincast.shaded.org.apache.http.client.methods.HttpEntityEnclosingRequestBase getHttpEntityEnclosingRequestBase(String url)
Copyright © 2017. All rights reserved.