Class BodySenderRequestBuilderBaseDefault<T extends BodySenderRequestBuilderBase<?>>
- All Implemented Interfaces:
BodySenderRequestBuilderBase<T>,HttpRequestBuilder<T>
- Direct Known Subclasses:
PatchRequestBuilderDefault,PostRequestBuilderDefault,PutRequestBuilderDefault
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBodySenderRequestBuilderBaseDefault(String url, CookieFactory cookieFactory, HttpResponseFactory spincastHttpResponseFactory, JsonManager jsonManager, XmlManager xmlManager, SpincastHttpClientUtils spincastHttpClientUtils, SpincastHttpClientConfig spincastHttpClientConfig) Constructor -
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 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.HttpRequestBaseCreates the HttpRequestBase depending on the HTTP method.protected List<FileToUpload>protected Stringprotected abstract org.spincast.shaded.org.apache.http.client.methods.HttpEntityEnclosingRequestBaseprotected JsonManagerprotected org.spincast.shaded.org.apache.http.HttpEntityprotected Stringprotected XmlManagersetBody(org.spincast.shaded.org.apache.http.HttpEntity body) Sets an customHttpEntitybody to be sent.setFormBodyField(String fieldName, List<String> values) Sets a field on the form body, with its values.setFormBodyFields(Map<String, List<String>> formFields) Sets fields on the form body.setJsonStringBody(Object object) Sets aJsonbody to be sent.setStringBody(String stringBody, String contentType) Sets a String body.setXmlStringBody(Object object) Sets aXMLbody to be sent.Methods inherited from class org.spincast.plugins.httpclient.builders.HttpRequestBuilderBase
addHeaderValue, addHeaderValues, addHTMLAcceptHeader, addJsonAcceptHeader, addPlainTextAcceptHeader, addXMLAcceptHeader, convertToApacheCookie, convertToApacheCookieTweakName, convertToApacheCookieTweakValue, createHttpClient, createHttpClientBuilder, disableRedirectHandling, disableSslCertificateErrors, getCookieEncoding, getCookieFactory, getCookieStore, getHeaders, getHttpAuthPassword, getHttpAuthUsername, getHttpClient, getHttpClientBuilder, getHttpRequestExecutor, getRequestConfig, getSpincastHttpClientConfig, getSpincastHttpClientUtils, getSpincastHttpResponseFactory, getUrl, isDisableRedirectHandling, isDisableSslCertificateErrors, send, sendGetRawResponse, setCookie, setCookie, setCookie, setCookies, setCookieStore, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
BodySenderRequestBuilderBaseDefault
public BodySenderRequestBuilderBaseDefault(String url, CookieFactory cookieFactory, HttpResponseFactory spincastHttpResponseFactory, JsonManager jsonManager, XmlManager xmlManager, SpincastHttpClientUtils spincastHttpClientUtils, SpincastHttpClientConfig spincastHttpClientConfig) Constructor
-
-
Method Details
-
getStringBodyEncoding
-
getFormBodyEncoding
-
getBodyType
-
getStandardBody
protected org.spincast.shaded.org.apache.http.HttpEntity getStandardBody() -
getJsonManager
-
getXmlManager
-
getFormBodyFields
-
getFileToUploads
-
addFormBodyFieldValue
Description copied from interface:BodySenderRequestBuilderBaseAdds 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
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
addFormBodyFieldValuein interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
setFormBodyField
Description copied from interface:BodySenderRequestBuilderBaseSets 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
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
setFormBodyFieldin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
setFormBodyFields
Description copied from interface:BodySenderRequestBuilderBaseSets 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
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
setFormBodyFieldsin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
setStringBody
Description copied from interface:BodySenderRequestBuilderBaseSets a String body.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
setStringBodyin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
setJsonStringBody
Description copied from interface:BodySenderRequestBuilderBaseSets aJsonbody to be sent.The specified object will be converted to a
Json's String representation and sent using theapplication/jsonContent-Type.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
setJsonStringBodyin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
setXmlStringBody
Description copied from interface:BodySenderRequestBuilderBaseSets aXMLbody to be sent.The specified object will be converted to
XMLand sent using theapplication/xmlContent-Type.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
setXmlStringBodyin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
setBody
Description copied from interface:BodySenderRequestBuilderBaseSets an customHttpEntitybody to be sent.Only one type of body can be set amongs:
- Form body
- String body
- File to upload body
-
Custom
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
setBodyin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
addFileToUploadBody
Description copied from interface:BodySenderRequestBuilderBaseAdds 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
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
addFileToUploadBodyin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>- Parameters:
path- the path to the file to upload, on the file system.name- the name to use for the uploaded file.
-
addFileToUploadBody
Description copied from interface:BodySenderRequestBuilderBaseAdds 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
HttpEntitybody
When you set or add something to a new type of body, the existing body is overwritten, if there is one.
- Specified by:
addFileToUploadBodyin interfaceBodySenderRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>- 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.
-
convertToNameValuePair
-
createMethodSpecificHttpRequest
protected org.spincast.shaded.org.apache.http.client.methods.HttpRequestBase createMethodSpecificHttpRequest(String url) Description copied from class:HttpRequestBuilderBaseCreates the HttpRequestBase depending on the HTTP method.- Specified by:
createMethodSpecificHttpRequestin classHttpRequestBuilderBase<T extends BodySenderRequestBuilderBase<?>>
-
getHttpEntityEnclosingRequestBase
protected abstract org.spincast.shaded.org.apache.http.client.methods.HttpEntityEnclosingRequestBase getHttpEntityEnclosingRequestBase(String url)
-