public class PostRequestBuilder extends Object
| Constructor and Description | 
|---|
PostRequestBuilder(String requestURL,
                  String inCharset,
                  String outCharset,
                  boolean useSinglePart)
This constructor initializes a new HTTP POST request with content type is set to multipart/form-data 
 | 
PostRequestBuilder(String requestURL,
                  String inCharset,
                  String outCharset,
                  Proxy proxy,
                  String proxyAuthLogin,
                  String proxyAuthPwd,
                  boolean useSinglePart)
This constructor initializes a new HTTP POST request with content type is set to multipart/form-data and uses a
 proxy server 
 | 
PostRequestBuilder(String requestURL,
                  String inCharset,
                  String outCharset,
                  String basicAuthLogin,
                  String basicAuthPwd,
                  Proxy proxy,
                  String proxyAuthLogin,
                  String proxyAuthPwd,
                  boolean useSinglePart)
This constructor initializes a new HTTP POST request with content type is set to multipart/form-data and uses a
 proxy server 
 | 
| Modifier and Type | Method and Description | 
|---|---|
PostRequestBuilder | 
addFilePart(String fieldName,
           byte[] uploadFile,
           String fileName,
           String contentType)
Adds a upload file section to the request 
 | 
PostRequestBuilder | 
addFormField(String name,
            String value)
Adds a form field to the request 
 | 
PostRequestResult | 
build()
Completes the request and receives response from the server. 
 | 
PostRequestResult | 
finish()
Deprecated. 
 
use  
build(), always return null !!! | 
boolean | 
isMaskAmp()  | 
PostRequestBuilder | 
setMaskAmp(boolean maskAmp)  | 
public PostRequestBuilder(String requestURL, String inCharset, String outCharset, boolean useSinglePart) throws IOException
requestURL - the request URLinCharset - the charset to user for the inputoutCharset - the charset to user for the outputuseSinglePart - Boolean if the post should be done as singeplartIOException - on errors during the post requestpublic PostRequestBuilder(String requestURL, String inCharset, String outCharset, Proxy proxy, String proxyAuthLogin, String proxyAuthPwd, boolean useSinglePart) throws IOException
requestURL - the request URLinCharset - the charset to user for the inputoutCharset - the charset to user for the outputproxy - the Proxy to userproxyAuthLogin - the login name for the proxyproxyAuthPwd - the login password for the proxyuseSinglePart - Boolean if the post should be done as singeplartIOException - on errors during the post requestpublic PostRequestBuilder(String requestURL, String inCharset, String outCharset, String basicAuthLogin, String basicAuthPwd, Proxy proxy, String proxyAuthLogin, String proxyAuthPwd, boolean useSinglePart) throws IOException
requestURL - the request URLinCharset - the charset to user for the inputoutCharset - the charset to user for the outputbasicAuthLogin - the basicAuth login namebasicAuthPwd - the basicAuth passwordproxy - the Proxy to userproxyAuthLogin - the login name for the proxyproxyAuthPwd - the login password for the proxyuseSinglePart - Boolean if the post should be done as singeplartIOException - on errors during the post requestpublic boolean isMaskAmp()
public PostRequestBuilder setMaskAmp(boolean maskAmp)
public PostRequestBuilder addFormField(String name, String value)
name - field namevalue - field valuepublic PostRequestBuilder addFilePart(String fieldName, byte[] uploadFile, String fileName, String contentType) throws IOException
fieldName - name attribute in uploadFile - a File to be uploadedIOException - on errors when writing the file part to the OutputStreampublic PostRequestResult build() throws IOException
IOException - on errors during building the request@Deprecated public PostRequestResult finish() throws IOException
build(), always return null !!!IOExceptionCopyright © 2020 XIMA MEDIA GmbH. All rights reserved.