Class EntityEnclosingMethod
- java.lang.Object
-
- org.apache.commons.httpclient.HttpMethodBase
-
- org.apache.commons.httpclient.methods.ExpectContinueMethod
-
- org.apache.commons.httpclient.methods.EntityEnclosingMethod
-
- All Implemented Interfaces:
HttpMethod
- Direct Known Subclasses:
PostMethod,PutMethod
@Deprecated public abstract class EntityEnclosingMethod extends ExpectContinueMethod
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.This abstract class serves as a foundation for all HTTP methods that can enclose an entity within requests- Since:
- 2.0beta1
-
-
Field Summary
Fields Modifier and Type Field Description static longCONTENT_LENGTH_AUTODeprecated.static longCONTENT_LENGTH_CHUNKEDDeprecated.
-
Constructor Summary
Constructors Constructor Description EntityEnclosingMethod()Deprecated.No-arg constructor.EntityEnclosingMethod(java.lang.String uri)Deprecated.Constructor specifying a URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleangetFollowRedirects()Deprecated.Entity enclosing requests cannot be redirected without user intervention according to RFC 2616.java.lang.StringgetRequestCharSet()Deprecated.Returns the request's charset.RequestEntitygetRequestEntity()Deprecated.voidrecycle()Deprecated.no longer supported and will be removed in the future version of HttpClientvoidsetContentChunked(boolean chunked)Deprecated.Sets whether or not the content should be chunked.voidsetFollowRedirects(boolean followRedirects)Deprecated.Entity enclosing requests cannot be redirected without user intervention according to RFC 2616.voidsetRequestBody(java.io.InputStream body)Deprecated.voidsetRequestBody(java.lang.String body)Deprecated.voidsetRequestContentLength(int length)Deprecated.voidsetRequestContentLength(long length)Deprecated.voidsetRequestEntity(RequestEntity requestEntity)Deprecated.-
Methods inherited from class org.apache.commons.httpclient.methods.ExpectContinueMethod
getUseExpectHeader, setUseExpectHeader
-
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
abort, 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, validate
-
-
-
-
Field Detail
-
CONTENT_LENGTH_AUTO
public static final long CONTENT_LENGTH_AUTO
Deprecated.The content length will be calculated automatically. This implies buffering of the content.- See Also:
- Constant Field Values
-
CONTENT_LENGTH_CHUNKED
public static final long CONTENT_LENGTH_CHUNKED
Deprecated.The request will use chunked transfer encoding. Content length is not calculated and the content is not buffered.- See Also:
- Constant Field Values
-
-
Method Detail
-
getFollowRedirects
public boolean getFollowRedirects()
Deprecated.Entity enclosing requests cannot be redirected without user intervention according to RFC 2616.- Specified by:
getFollowRedirectsin interfaceHttpMethod- Overrides:
getFollowRedirectsin classHttpMethodBase- Returns:
false.- Since:
- 2.0
-
setFollowRedirects
public void setFollowRedirects(boolean followRedirects)
Deprecated.Entity enclosing requests cannot be redirected without user intervention according to RFC 2616.- Specified by:
setFollowRedirectsin interfaceHttpMethod- Overrides:
setFollowRedirectsin classHttpMethodBase- Parameters:
followRedirects- must always befalse
-
setRequestContentLength
public void setRequestContentLength(int length)
Deprecated.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_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.
-
getRequestCharSet
public java.lang.String getRequestCharSet()
Deprecated.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.- Overrides:
getRequestCharSetin classHttpMethodBase- Returns:
- String The character set.
- Since:
- 3.0
- See Also:
RequestEntity.getContentType()
-
setRequestContentLength
public void setRequestContentLength(long length)
Deprecated.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_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.
-
setContentChunked
public void setContentChunked(boolean chunked)
Deprecated.Sets whether or not the content should be chunked.- Parameters:
chunked-trueif the content should be chunked- Since:
- 3.0
-
setRequestBody
public void setRequestBody(java.io.InputStream body)
Deprecated.Sets the request body to be the specified inputstream.- Parameters:
body- Request body content asInputStream
-
setRequestBody
public void setRequestBody(java.lang.String body)
Deprecated.Sets the request body to be the specified string. The string will be submitted, using the encoding specified in the Content-Type request header.
Example:setRequestHeader("Content-type", "text/xml; charset=UTF-8");
Would use the UTF-8 encoding. If no charset is specified, thedefaultcontent encoding is used (ISO-8859-1).- Parameters:
body- Request body content as a string
-
recycle
public void recycle()
Deprecated.no longer supported and will be removed in the future version of HttpClientRecycles 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.- Specified by:
recyclein interfaceHttpMethod- Overrides:
recyclein classHttpMethodBase- See Also:
HttpMethodBase.releaseConnection()
-
getRequestEntity
public RequestEntity getRequestEntity()
Deprecated.- Returns:
- Returns the requestEntity.
- Since:
- 3.0
-
setRequestEntity
public void setRequestEntity(RequestEntity requestEntity)
Deprecated.- Parameters:
requestEntity- The requestEntity to set.- Since:
- 3.0
-
-