| org.apache.commons.httpclient.methods.ExpectContinueMethod org.apache.commons.httpclient.methods.MultipartPostMethod
Method Summary | |
protected void | addContentLengthRequestHeader(HttpState state, HttpConnection conn) Adds a Content-Length request header, as long as no
Content-Length request header already exists.
Parameters: state - current state of http requests Parameters: conn - the connection to use for I/O throws: IOException - if an I/O (transport) error occurs. | protected void | addContentTypeRequestHeader(HttpState state, HttpConnection conn) Adds a Content-Type request header.
Parameters: state - current state of http requests Parameters: conn - the connection to use for I/O throws: IOException - if an I/O (transport) error occurs. | public void | addParameter(String parameterName, String parameterValue) | public void | addParameter(String parameterName, File parameterFile) | public void | addParameter(String parameterName, String fileName, File parameterFile) | public void | addPart(Part part) Adds a part. | protected void | addRequestHeaders(HttpState state, HttpConnection conn) Populates the request headers map to with additional
org.apache.commons.httpclient.Header 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.
Parameters: state - the HttpState state information associated with this method Parameters: conn - the HttpConnection connection used to executethis HTTP method throws: IOException - if an I/O (transport) error occurs. | public String | getName() Returns "POST". | public Part[] | getParts() Returns all parts. | protected long | getRequestContentLength() | protected boolean | hasRequestContent() | public void | recycle() 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. | protected boolean | writeRequestBody(HttpState state, HttpConnection conn) Writes the request body to the given
HttpConnection connection .
Parameters: state - the HttpState state information associated with this method Parameters: conn - the HttpConnection connection used to executethis HTTP method true throws: IOException - if an I/O (transport) error occurs. |
MULTIPART_FORM_CONTENT_TYPE | final public static String MULTIPART_FORM_CONTENT_TYPE(Code) | | The Content-Type for multipart/form-data.
|
MultipartPostMethod | public MultipartPostMethod()(Code) | | No-arg constructor.
|
MultipartPostMethod | public MultipartPostMethod(String uri)(Code) | | Constructor specifying a URI.
Parameters: uri - either an absolute or relative URI |
addContentLengthRequestHeader | protected void addContentLengthRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code) | | Adds a Content-Length request header, as long as no
Content-Length request header already exists.
Parameters: state - current state of http requests Parameters: conn - the connection to use for I/O throws: IOException - if an I/O (transport) error occurs. Some transport exceptionscan be recovered from. throws: HttpException - if a protocol exception occurs. Usually protocol exceptions cannot be recovered from. since: 3.0 |
addContentTypeRequestHeader | protected void addContentTypeRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code) | | Adds a Content-Type request header.
Parameters: state - current state of http requests Parameters: conn - the connection to use for I/O throws: IOException - if an I/O (transport) error occurs. Some transport exceptionscan be recovered from. throws: HttpException - if a protocol exception occurs. Usually protocol exceptions cannot be recovered from. since: 3.0 |
addParameter | public void addParameter(String parameterName, String parameterValue)(Code) | | Adds a text field part
Parameters: parameterName - The name of the parameter. Parameters: parameterValue - The value of the parameter. |
addParameter | public void addParameter(String parameterName, File parameterFile) throws FileNotFoundException(Code) | | Adds a binary file part
Parameters: parameterName - The name of the parameter Parameters: parameterFile - 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(Code) | | Adds a binary file part with the given file name
Parameters: parameterName - The name of the parameter Parameters: fileName - The file name Parameters: parameterFile - The file throws: FileNotFoundException - If the file cannot be found. |
addPart | public void addPart(Part part)(Code) | | Adds a part.
Parameters: part - The part to add. |
getParts | public Part[] getParts()(Code) | | Returns all parts.
an array of containing all parts |
getRequestContentLength | protected long getRequestContentLength() throws IOException(Code) | | Return the length of the request body.
Once this method has been invoked, the request parameters cannot be
altered until the method is
MultipartPostMethod.recycle recycled .
The request content length. |
hasRequestContent | protected boolean hasRequestContent()(Code) | | Returns true
true since: 2.0beta1 |
recycle | public void recycle()(Code) | | 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.
See Also: MultipartPostMethod.releaseConnection() |
writeRequestBody | protected boolean writeRequestBody(HttpState state, HttpConnection conn) throws IOException, HttpException(Code) | | Writes the request body to the given
HttpConnection connection .
Parameters: state - the HttpState state information associated with this method Parameters: conn - the HttpConnection connection used to executethis HTTP method true throws: IOException - if an I/O (transport) error occurs. Some transport exceptionscan be recovered from. throws: HttpException - if a protocol exception occurs. Usually protocol exceptions cannot be recovered from. |
|
|