| |
|
| org.apache.commons.httpclient.methods.ExpectContinueMethod org.apache.commons.httpclient.methods.EntityEnclosingMethod
All known Subclasses: org.apache.commons.httpclient.methods.PostMethod, org.apache.commons.httpclient.methods.PutMethod,
EntityEnclosingMethod | abstract public class EntityEnclosingMethod extends ExpectContinueMethod (Code) | | This abstract class serves as a foundation for all HTTP methods
that can enclose an entity within requests
author: Oleg Kalnichevski author: Jeff Dever since: 2.0beta1 version: $Revision: 480424 $ |
EntityEnclosingMethod | public EntityEnclosingMethod()(Code) | | No-arg constructor.
since: 2.0 |
EntityEnclosingMethod | public EntityEnclosingMethod(String uri)(Code) | | Constructor specifying a URI.
Parameters: uri - either an absolute or relative URI since: 2.0 |
addContentLengthRequestHeader | protected void addContentLengthRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException(Code) | | Generates Content-Length or Transfer-Encoding: Chunked
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 - when errors occur reading or writing to/from theconnection throws: HttpException - when a recoverable error occurs |
clearRequestBody | protected void clearRequestBody()(Code) | | Clears the request body.
This method must be overridden by sub-classes that implement
alternative request content input methods.
since: 2.0beta1 |
generateRequestBody | protected byte[] generateRequestBody()(Code) | | Generates the request body.
This method must be overridden by sub-classes that implement
alternative request content input methods.
request body as an array of bytes. If the request content has not been set, returns null. since: 2.0beta1 |
getFollowRedirects | public boolean getFollowRedirects()(Code) | | Entity enclosing requests cannot be redirected without user intervention
according to RFC 2616.
false . since: 2.0 |
getRequestCharSet | public String getRequestCharSet()(Code) | | Returns the request's charset. The charset is parsed from the request entity's
content type, unless the content type header has been set manually.
See Also: RequestEntity.getContentType since: 3.0 |
getRequestContentLength | protected long getRequestContentLength()(Code) | | Returns the length of the request body.
number of bytes in the request body |
getRequestEntity | public RequestEntity getRequestEntity()(Code) | | Returns the requestEntity. since: 3.0 |
hasRequestContent | protected boolean hasRequestContent()(Code) | | Returns true if there is a request body to be sent.
This method must be overridden by sub-classes that implement
alternative request content input methods
boolean 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: EntityEnclosingMethod.releaseConnection() |
setContentChunked | public void setContentChunked(boolean chunked)(Code) | | Sets whether or not the content should be chunked.
Parameters: chunked - true if the content should be chunked since: 3.0 |
setFollowRedirects | public void setFollowRedirects(boolean followRedirects)(Code) | | Entity enclosing requests cannot be redirected without user intervention
according to RFC 2616.
Parameters: followRedirects - must always be false |
setRequestContentLength | public void setRequestContentLength(int length)(Code) | | Sets length information about the request body.
Note: If you specify a content length the request is unbuffered. This
prevents redirection and automatic retry if a request fails the first
time. This means that the HttpClient can not perform authorization
automatically but will throw an Exception. You will have to set the
necessary 'Authorization' or 'Proxy-Authorization' headers manually.
Parameters: length - size in bytes or any of CONTENT_LENGTH_AUTO,CONTENT_LENGTH_CHUNKED. If number of bytes or CONTENT_LENGTH_CHUNKEDis specified the content will not be buffered internally and theContent-Length header of the request will be used. In this casethe user is responsible to supply the correct content length.If CONTENT_LENGTH_AUTO is specified the request will be bufferedbefore it is sent over the network.EntityEnclosingMethod.setContentChunked(boolean)EntityEnclosingMethod.setRequestEntity(RequestEntity) |
setRequestContentLength | public void setRequestContentLength(long length)(Code) | | Sets length information about the request body.
Note: If you specify a content length the request is unbuffered. This
prevents redirection and automatic retry if a request fails the first
time. This means that the HttpClient can not perform authorization
automatically but will throw an Exception. You will have to set the
necessary 'Authorization' or 'Proxy-Authorization' headers manually.
Parameters: length - size in bytes or any of CONTENT_LENGTH_AUTO,CONTENT_LENGTH_CHUNKED. If number of bytes or CONTENT_LENGTH_CHUNKEDis specified the content will not be buffered internally and theContent-Length header of the request will be used. In this casethe user is responsible to supply the correct content length.If CONTENT_LENGTH_AUTO is specified the request will be bufferedbefore it is sent over the network.EntityEnclosingMethod.setContentChunked(boolean)EntityEnclosingMethod.setRequestEntity(RequestEntity) |
setRequestEntity | public void setRequestEntity(RequestEntity requestEntity)(Code) | | Parameters: requestEntity - The requestEntity to set. since: 3.0 |
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. |
|
|
|