public abstract class EntityEnclosingMethod extends ExpectContinueMethod
| Modifier and Type | Field and Description |
|---|---|
static long |
CONTENT_LENGTH_AUTO
Deprecated.
|
static long |
CONTENT_LENGTH_CHUNKED
Deprecated.
|
| Constructor and Description |
|---|
EntityEnclosingMethod()
No-arg constructor.
|
EntityEnclosingMethod(String uri)
Constructor specifying a URI.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getFollowRedirects()
Entity enclosing requests cannot be redirected without user intervention
according to RFC 2616.
|
String |
getRequestCharSet()
Returns the request's charset.
|
RequestEntity |
getRequestEntity() |
void |
recycle()
Deprecated.
no longer supported and will be removed in the future
version of HttpClient
|
void |
setContentChunked(boolean chunked)
Sets whether or not the content should be chunked.
|
void |
setFollowRedirects(boolean followRedirects)
Entity enclosing requests cannot be redirected without user intervention
according to RFC 2616.
|
void |
setRequestBody(InputStream body)
Deprecated.
|
void |
setRequestBody(String body)
Deprecated.
|
void |
setRequestContentLength(int length)
Deprecated.
|
void |
setRequestContentLength(long length)
Deprecated.
|
void |
setRequestEntity(RequestEntity requestEntity) |
getUseExpectHeader, setUseExpectHeaderabort, addRequestHeader, addRequestHeader, addResponseFooter, execute, getAuthenticationRealm, getDoAuthentication, getEffectiveVersion, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getName, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestHeader, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaders, getResponseHeaders, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isHttp11, isRequestSent, isStrictMode, releaseConnection, removeRequestHeader, removeRequestHeader, setDoAuthentication, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setStrictMode, setURI, validatepublic static final long CONTENT_LENGTH_AUTO
InputStreamRequestEntity.CONTENT_LENGTH_AUTO.public static final long CONTENT_LENGTH_CHUNKED
setContentChunked(boolean).public EntityEnclosingMethod()
public EntityEnclosingMethod(String uri)
uri - either an absolute or relative URIpublic boolean getFollowRedirects()
getFollowRedirects in interface HttpMethodgetFollowRedirects in class HttpMethodBasefalse.public void setFollowRedirects(boolean followRedirects)
setFollowRedirects in interface HttpMethodsetFollowRedirects in class HttpMethodBasefollowRedirects - must always be falsepublic void setRequestContentLength(int length)
setContentChunked(boolean) or
setRequestEntity(RequestEntity)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.
length - size in bytes or any of CONTENT_LENGTH_AUTO,
CONTENT_LENGTH_CHUNKED. If number of bytes or CONTENT_LENGTH_CHUNKED
is specified the content will not be buffered internally and the
Content-Length header of the request will be used. In this case
the user is responsible to supply the correct content length.
If CONTENT_LENGTH_AUTO is specified the request will be buffered
before it is sent over the network.public String getRequestCharSet()
getRequestCharSet in class HttpMethodBaseRequestEntity.getContentType()public void setRequestContentLength(long length)
setContentChunked(boolean) or
setRequestEntity(RequestEntity)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.
length - size in bytes or any of CONTENT_LENGTH_AUTO,
CONTENT_LENGTH_CHUNKED. If number of bytes or CONTENT_LENGTH_CHUNKED
is specified the content will not be buffered internally and the
Content-Length header of the request will be used. In this case
the user is responsible to supply the correct content length.
If CONTENT_LENGTH_AUTO is specified the request will be buffered
before it is sent over the network.public void setContentChunked(boolean chunked)
chunked - true if the content should be chunkedpublic void setRequestBody(InputStream body)
setRequestEntity(RequestEntity)body - Request body content as InputStreampublic void setRequestBody(String body)
setRequestEntity(RequestEntity)setRequestHeader("Content-type", "text/xml; charset=UTF-8");default
content encoding is used (ISO-8859-1).body - Request body content as a stringpublic void recycle()
recycle in interface HttpMethodrecycle in class HttpMethodBaseHttpMethodBase.releaseConnection()public RequestEntity getRequestEntity()
public void setRequestEntity(RequestEntity requestEntity)
requestEntity - The requestEntity to set.Copyright © 2010 - 2020 Adobe. All Rights Reserved