|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpMethodBase | +--org.apache.commons.httpclient.methods.GetMethod | +--org.apache.commons.httpclient.methods.ExpectContinueMethod | +--org.apache.commons.httpclient.methods.MultipartPostMethod
POST Method for Multipart encoded forms.
Field Summary | |
static String |
MULTIPART_FORM_CONTENT_TYPE
The Content-Type for multipart/form-data. |
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase |
USER_AGENT |
Constructor Summary | |
MultipartPostMethod()
No-arg constructor. |
|
MultipartPostMethod(String uri)
Constructor specifying a URI. |
|
MultipartPostMethod(String uri,
String tempDir)
Constructor specifying a URI and tempDir. |
|
MultipartPostMethod(String uri,
String tempDir,
String tempFile)
Constructor specifying a URI, tempDir and tempFile. |
Method Summary | |
void |
addParameter(String parameterName,
File parameterFile)
Add a parameter |
void |
addParameter(String parameterName,
String parameterValue)
Add a parameter |
void |
addParameter(String parameterName,
String fileName,
File parameterFile)
Add a parameter. |
void |
addPart(Part part)
Adds another part to this post. |
protected void |
addRequestHeaders(HttpState state,
HttpConnection conn)
Add content type header and set the Expect header if it has not already been set, in addition to the "standard" set of headers |
String |
getName()
Returns "POST". |
Part[] |
getParts()
Return all parts. |
protected int |
getRequestContentLength()
Return the length of the request body. |
protected boolean |
hasRequestContent()
Returns true |
void |
recycle()
Clear my request body. |
protected boolean |
writeRequestBody(HttpState state,
HttpConnection conn)
Write the request body. |
Methods inherited from class org.apache.commons.httpclient.methods.ExpectContinueMethod |
getUseExpectHeader,
setUseExpectHeader |
Methods inherited from class org.apache.commons.httpclient.methods.GetMethod |
getFileData,
getTempDir,
getTempFile,
getUseDisk,
readResponseBody,
setFileData,
setTempDir,
setTempFile,
setUseDisk |
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 URIpublic MultipartPostMethod(String uri, String tempDir)
uri
- either an absolute or relative URItempDir
- directory to store temp files inpublic MultipartPostMethod(String uri, String tempDir, String tempFile)
uri
- either an absolute or relative URItempDir
- directory to store temp files intempFile
- file to store temporary data inMethod Detail |
protected boolean hasRequestContent()
public String getName()
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.public void addParameter(String parameterName, String fileName, File parameterFile) throws FileNotFoundException
parameterName
- The name of the parameterfileName
- The file nameparameterFile
- The filepublic void addPart(Part part)
part
- The part to add.public Part[] getParts()
protected void addRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException
state
- the client stateconn
- the HttpConnection
the headers will eventually be
written toprotected boolean writeRequestBody(HttpState state, HttpConnection conn) throws IOException, HttpException
state
- the client stateconn
- the connection to write toprotected int getRequestContentLength()
Return the length of the request body.
Once this method has been invoked, the request parameters cannot be
altered until I am recycled
.
public void recycle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |