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
- inCharset
- outCharset
- useSinglePart
- IOException
public PostRequestBuilder(String requestURL, String inCharset, String outCharset, Proxy proxy, String proxyAuthLogin, String proxyAuthPwd, boolean useSinglePart) throws IOException
requestURL
- inCharset
- outCharset
- proxy
- proxyAuthLogin
- proxyAuthPwd
- useSinglePart
- IOException
public PostRequestBuilder(String requestURL, String inCharset, String outCharset, String basicAuthLogin, String basicAuthPwd, Proxy proxy, String proxyAuthLogin, String proxyAuthPwd, boolean useSinglePart) throws IOException
requestURL
- inCharset
- outCharset
- basicAuthLogin
- basicAuthPwd
- proxy
- proxyAuthLogin
- proxyAuthPwd
- useSinglePart
- IOException
public 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
public PostRequestResult build() throws IOException
IOException
@Deprecated public PostRequestResult finish() throws IOException
build()
, always return null
!!!IOException
Copyright © 2019 XIMA MEDIA GmbH. All rights reserved.