public abstract class HttpRequestBodyMethodBase
extends org.apache.commons.httpclient.HttpMethodBase
Constructor and Description |
---|
HttpRequestBodyMethodBase()
Default constructor.
|
HttpRequestBodyMethodBase(java.lang.String uri)
URI-setting constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getRequestContentLength()
Override the method of
HttpMethodBase
to return the appropriate content length. |
protected boolean |
isRequestContentAlreadySet()
return true, if the method setRequestContent has been called (with a null parameter)
|
boolean |
readContinueCode()
Returns true if 100 Continue status code
is found.
|
void |
recycle() |
void |
setRequestBody(byte[] bodydata)
Set my request body content to the contents of a byte array.
|
void |
setRequestBody(java.io.File file)
Set my request body content to the contents of a file.
|
void |
setRequestBody(java.io.InputStream is)
Set my request body content to the contents of an input stream.
|
void |
setRequestBody(java.lang.String bodydata)
Set my request body content to the contents of a string.
|
void |
setRequestBody(java.net.URL url)
Set my request body content to the resource at the specified URL.
|
protected boolean |
writeRequestBody(org.apache.commons.httpclient.HttpState state,
org.apache.commons.httpclient.HttpConnection conn)
Do write the request body.
|
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getName, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, 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, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
public HttpRequestBodyMethodBase()
public HttpRequestBodyMethodBase(java.lang.String uri)
uri
- the URI to request. The URI is expected
to be already URL encoded. It may be either an absolute or
server relative path.public void setRequestBody(java.io.File file) throws java.io.IOException
java.io.IOException
public void setRequestBody(java.net.URL url) throws java.io.IOException
java.io.IOException
public void setRequestBody(byte[] bodydata)
public void setRequestBody(java.lang.String bodydata)
public void setRequestBody(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public boolean readContinueCode()
protected boolean writeRequestBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws java.io.IOException, org.apache.commons.httpclient.HttpException
HttpMethodBase
if the method should wait until a 100 Continue status code
is expected (@link readContinueCode)writeRequestBody
in class org.apache.commons.httpclient.HttpMethodBase
java.io.IOException
org.apache.commons.httpclient.HttpException
protected int getRequestContentLength()
HttpMethodBase
to return the appropriate content length.protected boolean isRequestContentAlreadySet()
public void recycle()
recycle
in interface org.apache.commons.httpclient.HttpMethod
recycle
in class org.apache.commons.httpclient.HttpMethodBase