Class MultipartPostMethod
java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
org.apache.commons.httpclient.methods.ExpectContinueMethod
org.apache.commons.httpclient.methods.MultipartPostMethod
- All Implemented Interfaces:
HttpMethod
Deprecated.
Implements the HTTP multipart POST method.
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.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.The Content-Type for multipart/form-data. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.No-arg constructor.Deprecated.Constructor specifying a URI. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(String parameterName, File parameterFile) Deprecated.Adds a binary file partvoid
addParameter
(String parameterName, String parameterValue) Deprecated.Adds a text field partvoid
addParameter
(String parameterName, String fileName, File parameterFile) Deprecated.Adds a binary file part with the given file namevoid
Deprecated.Adds a part.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 HttpClientMethods inherited from class org.apache.commons.httpclient.methods.ExpectContinueMethod
getUseExpectHeader, setUseExpectHeader
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
abort, 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, validate
-
Field Details
-
MULTIPART_FORM_CONTENT_TYPE
Deprecated.The Content-Type for multipart/form-data.- See Also:
-
-
Constructor Details
-
MultipartPostMethod
public MultipartPostMethod()Deprecated.No-arg constructor. -
MultipartPostMethod
Deprecated.Constructor specifying a URI.- Parameters:
uri
- either an absolute or relative URI
-
-
Method Details
-
getName
Deprecated.Returns "POST".- Specified by:
getName
in interfaceHttpMethod
- Specified by:
getName
in classHttpMethodBase
- Returns:
- "POST"
-
addParameter
Deprecated.Adds a text field part- Parameters:
parameterName
- The name of the parameter.parameterValue
- The value of the parameter.
-
addParameter
Deprecated.Adds a binary file part- Parameters:
parameterName
- The name of the parameterparameterFile
- The name of the file.- Throws:
FileNotFoundException
- If the file cannot be found.
-
addParameter
public void addParameter(String parameterName, String fileName, File parameterFile) throws FileNotFoundException Deprecated.Adds a binary file part with the given file name- Parameters:
parameterName
- The name of the parameterfileName
- The file nameparameterFile
- The file- Throws:
FileNotFoundException
- If the file cannot be found.
-
addPart
Deprecated.Adds a part.- Parameters:
part
- The part to add.
-
getParts
Deprecated.Returns all parts.- Returns:
- an array of containing all parts
-
recycle
public void recycle()Deprecated.no longer supported and will be removed in the future version of HttpClientRecycles the HTTP method so that it can be used again. Note that all of the instance variables will be reset once this method has been called. This method will also release the connection being used by this HTTP method.- Specified by:
recycle
in interfaceHttpMethod
- Overrides:
recycle
in classHttpMethodBase
- See Also:
-
MultipartRequestEntity
in conjunction withPostMethod
instead.