MultipartRequestEntity
in conjunction with PostMethod instead.public class MultipartPostMethod extends ExpectContinueMethod
The HTTP multipart POST method is defined in section 3.3 of RFC1867:
The media-type multipart/form-data follows the rules of all multipart MIME data streams as outlined in RFC 1521. The multipart/form-data contains a series of parts. Each part is expected to contain a content-disposition header where the value is "form-data" and a name attribute specifies the field name within the form, e.g., 'content-disposition: form-data; name="xxxxx"', where xxxxx is the field name corresponding to that field. Field names originally in non-ASCII character sets may be encoded using the method outlined in RFC 1522.
| Modifier and Type | Field and Description |
|---|---|
static String |
MULTIPART_FORM_CONTENT_TYPE
Deprecated.
The Content-Type for multipart/form-data.
|
| Constructor and Description |
|---|
MultipartPostMethod()
Deprecated.
No-arg constructor.
|
MultipartPostMethod(String uri)
Deprecated.
Constructor specifying a URI.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String parameterName,
File parameterFile)
Deprecated.
Adds a binary file part
|
void |
addParameter(String parameterName,
String parameterValue)
Deprecated.
Adds a text field part
|
void |
addParameter(String parameterName,
String fileName,
File parameterFile)
Deprecated.
Adds a binary file part with the given file name
|
void |
addPart(Part part)
Deprecated.
Adds a part.
|
String |
getName()
Deprecated.
Returns "POST".
|
Part[] |
getParts()
Deprecated.
Returns all parts.
|
void |
recycle()
Deprecated.
no longer supported and will be removed in the future
version of HttpClient
|
getUseExpectHeader, setUseExpectHeaderabort, addRequestHeader, addRequestHeader, addResponseFooter, execute, getAuthenticationRealm, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaders, getResponseHeaders, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isHttp11, isRequestSent, isStrictMode, releaseConnection, removeRequestHeader, removeRequestHeader, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setStrictMode, setURI, validatepublic static final String MULTIPART_FORM_CONTENT_TYPE
public MultipartPostMethod()
public MultipartPostMethod(String uri)
uri - either an absolute or relative URIpublic String getName()
getName in interface HttpMethodgetName in class HttpMethodBasepublic void addParameter(String parameterName, String parameterValue)
parameterName - The name of the parameter.parameterValue - The value of the parameter.public void addParameter(String parameterName, File parameterFile) throws FileNotFoundException
parameterName - The name of the parameterparameterFile - The name of the file.FileNotFoundException - If the file cannot be found.public void addParameter(String parameterName, String fileName, File parameterFile) throws FileNotFoundException
parameterName - The name of the parameterfileName - The file nameparameterFile - The fileFileNotFoundException - If the file cannot be found.public void addPart(Part part)
part - The part to add.public Part[] getParts()
public void recycle()
recycle in interface HttpMethodrecycle in class HttpMethodBaseHttpMethodBase.releaseConnection()Copyright © 2010 - 2020 Adobe. All Rights Reserved