|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.httpclient.HttpMethodBase
org.apache.commons.httpclient.methods.ExpectContinueMethod
org.apache.commons.httpclient.methods.MultipartPostMethod
MultipartRequestEntity
in conjunction with PostMethod instead.
public class MultipartPostMethod
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 | |
|---|---|
static String |
MULTIPART_FORM_CONTENT_TYPE
Deprecated. The Content-Type for multipart/form-data. |
| Fields inherited from class org.apache.commons.httpclient.HttpMethodBase |
|---|
effectiveVersion, statusLine |
| Constructor Summary | |
|---|---|
MultipartPostMethod()
Deprecated. No-arg constructor. |
|
MultipartPostMethod(String uri)
Deprecated. Constructor specifying a URI. |
|
| Method Summary | |
|---|---|
protected void |
addContentLengthRequestHeader(HttpState state,
HttpConnection conn)
Deprecated. Adds a Content-Length request header, as long as no Content-Length request header already exists. |
protected void |
addContentTypeRequestHeader(HttpState state,
HttpConnection conn)
Deprecated. Adds a Content-Type request header. |
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. |
protected void |
addRequestHeaders(HttpState state,
HttpConnection conn)
Deprecated. Populates the request headers map to with additional headers to be submitted to
the given HttpConnection. |
String |
getName()
Deprecated. Returns "POST". |
Part[] |
getParts()
Deprecated. Returns all parts. |
protected long |
getRequestContentLength()
Deprecated. Return the length of the request body. |
protected boolean |
hasRequestContent()
Deprecated. Returns true |
void |
recycle()
Deprecated. no longer supported and will be removed in the future version of HttpClient |
protected boolean |
writeRequestBody(HttpState state,
HttpConnection conn)
Deprecated. Writes the request body to the given connection. |
| Methods inherited from class org.apache.commons.httpclient.methods.ExpectContinueMethod |
|---|
getUseExpectHeader, setUseExpectHeader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MULTIPART_FORM_CONTENT_TYPE
| Constructor Detail |
|---|
public MultipartPostMethod()
public MultipartPostMethod(String uri)
uri - either an absolute or relative URI| Method Detail |
|---|
protected boolean hasRequestContent()
hasRequestContent in class ExpectContinueMethodpublic String getName()
getName in interface HttpMethodgetName in class HttpMethodBase
public 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 file
FileNotFoundException - If the file cannot be found.public void addPart(Part part)
part - The part to add.public Part[] getParts()
protected void addContentLengthRequestHeader(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
state - current state of http requestsconn - the connection to use for I/O
IOException - if an I/O (transport) error occurs. Some transport exceptions
can be recovered from.
HttpException - if a protocol exception occurs. Usually protocol exceptions
cannot be recovered from.
protected void addContentTypeRequestHeader(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
state - current state of http requestsconn - the connection to use for I/O
IOException - if an I/O (transport) error occurs. Some transport exceptions
can be recovered from.
HttpException - if a protocol exception occurs. Usually protocol exceptions
cannot be recovered from.
protected void addRequestHeaders(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
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.
addRequestHeaders in class ExpectContinueMethodstate - the state information associated with this methodconn - the connection used to execute
this HTTP method
IOException - if an I/O (transport) error occurs. Some transport exceptions
can be recovered from.
HttpException - if a protocol exception occurs. Usually protocol exceptions
cannot be recovered from.HttpMethodBase.writeRequestHeaders(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpConnection)
protected boolean writeRequestBody(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
connection.
writeRequestBody in class HttpMethodBasestate - the state information associated with this methodconn - the connection used to execute
this HTTP method
IOException - if an I/O (transport) error occurs. Some transport exceptions
can be recovered from.
HttpException - if a protocol exception occurs. Usually protocol exceptions
cannot be recovered from.
protected long getRequestContentLength()
throws IOException
Return the length of the request body.
Once this method has been invoked, the request parameters cannot be
altered until the method is recycled.
IOExceptionpublic void recycle()
recycle in interface HttpMethodrecycle in class HttpMethodBaseHttpMethodBase.releaseConnection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||