Save This Page
Home » commons-httpclient-3.1-src » org.apache.commons » httpclient » methods » [javadoc | source]
org.apache.commons.httpclient.methods
public class: MultipartPostMethod [javadoc | source]
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! Use - org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity in conjunction with org.apache.commons.httpclient.methods.PostMethod instead.

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.

Field Summary
public static final  String MULTIPART_FORM_CONTENT_TYPE    The Content-Type for multipart/form-data. 
Fields inherited from org.apache.commons.httpclient.HttpMethodBase:
statusLine,  effectiveVersion
Constructor:
 public MultipartPostMethod() 
 public MultipartPostMethod(String uri) 
    Constructor specifying a URI.
    Parameters:
    uri - either an absolute or relative URI
Method from org.apache.commons.httpclient.methods.MultipartPostMethod Summary:
addContentLengthRequestHeader,   addContentTypeRequestHeader,   addParameter,   addParameter,   addParameter,   addPart,   addRequestHeaders,   getName,   getParts,   getRequestContentLength,   hasRequestContent,   recycle,   writeRequestBody
Methods from org.apache.commons.httpclient.methods.ExpectContinueMethod:
addRequestHeaders,   getUseExpectHeader,   hasRequestContent,   setUseExpectHeader
Methods from org.apache.commons.httpclient.HttpMethodBase:
abort,   addCookieRequestHeader,   addHostRequestHeader,   addProxyConnectionHeader,   addRequestHeader,   addRequestHeader,   addRequestHeaders,   addResponseFooter,   addUserAgentRequestHeader,   checkNotUsed,   checkUsed,   execute,   fakeResponse,   generateRequestLine,   getAuthenticationRealm,   getContentCharSet,   getDoAuthentication,   getEffectiveVersion,   getFollowRedirects,   getHostAuthState,   getHostConfiguration,   getMethodRetryHandler,   getName,   getParams,   getPath,   getProxyAuthState,   getProxyAuthenticationRealm,   getQueryString,   getRecoverableExceptionCount,   getRequestCharSet,   getRequestHeader,   getRequestHeaderGroup,   getRequestHeaders,   getRequestHeaders,   getResponseBody,   getResponseBody,   getResponseBodyAsStream,   getResponseBodyAsString,   getResponseBodyAsString,   getResponseCharSet,   getResponseContentLength,   getResponseFooter,   getResponseFooters,   getResponseHeader,   getResponseHeaderGroup,   getResponseHeaders,   getResponseHeaders,   getResponseStream,   getResponseTrailerHeaderGroup,   getStatusCode,   getStatusLine,   getStatusText,   getURI,   hasBeenUsed,   isAborted,   isConnectionCloseForced,   isHttp11,   isRequestSent,   isStrictMode,   processCookieHeaders,   processResponseBody,   processResponseHeaders,   processStatusLine,   readResponse,   readResponseBody,   readResponseHeaders,   readStatusLine,   recycle,   releaseConnection,   removeRequestHeader,   removeRequestHeader,   responseBodyConsumed,   setConnectionCloseForced,   setDoAuthentication,   setFollowRedirects,   setHostConfiguration,   setHttp11,   setMethodRetryHandler,   setParams,   setPath,   setQueryString,   setQueryString,   setRequestHeader,   setRequestHeader,   setResponseStream,   setStrictMode,   setURI,   shouldCloseConnection,   validate,   writeRequest,   writeRequestBody,   writeRequestHeaders,   writeRequestLine
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.httpclient.methods.MultipartPostMethod Detail:
 protected  void addContentLengthRequestHeader(HttpState state,
    HttpConnection conn) throws IOException, HttpException 
      Deprecated!
    Adds a Content-Length request header, as long as no Content-Length request header already exists.
 protected  void addContentTypeRequestHeader(HttpState state,
    HttpConnection conn) throws IOException, HttpException 
      Deprecated!
    Adds a Content-Type request header.
 public  void addParameter(String parameterName,
    String parameterValue) 
      Deprecated!
    Adds a text field part
 public  void addParameter(String parameterName,
    File parameterFile) throws FileNotFoundException 
      Deprecated!
    Adds a binary file part
 public  void addParameter(String parameterName,
    String fileName,
    File parameterFile) throws FileNotFoundException 
      Deprecated!
    Adds a binary file part with the given file name
 public  void addPart(Part part) 
      Deprecated!
    Adds a part.
 protected  void addRequestHeaders(HttpState state,
    HttpConnection conn) throws IOException, HttpException 
      Deprecated!
    Populates the request headers map to with additional headers to be submitted to the given HttpConnection .

    This implementation adds tt>Content-Length and Content-Type headers, when appropriate.

    Subclasses may want to override this method to to add additional headers, and may choose to invoke this implementation (via super) to add the "standard" headers.

 public String getName() 
      Deprecated!
    Returns "POST".
 public Part[] getParts() 
      Deprecated!
    Returns all parts.
 protected long getRequestContentLength() throws IOException 
      Deprecated!

    Return the length of the request body.

    Once this method has been invoked, the request parameters cannot be altered until the method is recycled .

 protected boolean hasRequestContent() 
      Deprecated!
    Returns true
 public  void recycle() 
Deprecated! no - longer supported and will be removed in the future version of HttpClient

      Deprecated!
    Recycles 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.
 protected boolean writeRequestBody(HttpState state,
    HttpConnection conn) throws IOException, HttpException 
      Deprecated!