Class HttpMethodBase
- java.lang.Object
-
- org.apache.commons.httpclient.HttpMethodBase
-
- All Implemented Interfaces:
HttpMethod
- Direct Known Subclasses:
ConnectMethod
,DeleteMethod
,ExpectContinueMethod
,GetMethod
,HeadMethod
,OptionsMethod
,TraceMethod
@Deprecated public abstract class HttpMethodBase extends java.lang.Object implements HttpMethod
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.An abstract base implementation of HttpMethod.At minimum, subclasses will need to override:
getName()
to return the approriate name for this method
When a method requires additional request headers, subclasses will typically want to override:
addRequestHeaders(HttpState,HttpConnection)
to write those headers
When a method expects specific response headers, subclasses may want to override:
processResponseHeaders(HttpState,HttpConnection)
to handle those headers
-
-
Constructor Summary
Constructors Constructor Description HttpMethodBase()
Deprecated.No-arg constructor.HttpMethodBase(java.lang.String uri)
Deprecated.Constructor specifying a URI.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
abort()
Deprecated.Aborts the execution of this method.void
addRequestHeader(java.lang.String headerName, java.lang.String headerValue)
Deprecated.Adds the specified request header, NOT overwriting any previous value.void
addRequestHeader(Header header)
Deprecated.Adds the specified request header, NOT overwriting any previous value.void
addResponseFooter(Header footer)
Deprecated.Use this method internally to add footers.int
execute(HttpState state, HttpConnection conn)
Deprecated.Executes this method using the specifiedHttpConnection
andHttpState
.java.lang.String
getAuthenticationRealm()
Deprecated.use #getHostAuthState()boolean
getDoAuthentication()
Deprecated.Returns true if the HTTP method should automatically handle HTTP authentication challenges (status code 401, etc.), false otherwiseHttpVersion
getEffectiveVersion()
Deprecated.Returns the HTTP version used with this method (may be null if undefined, that is, the method has not been executed)boolean
getFollowRedirects()
Deprecated.Returns true if the HTTP method should automatically follow HTTP redirects (status code 302, etc.), false otherwise.AuthState
getHostAuthState()
Deprecated.Returns the target hostauthentication state
HostConfiguration
getHostConfiguration()
Deprecated.no longer applicableMethodRetryHandler
getMethodRetryHandler()
Deprecated.useHttpMethodParams
abstract java.lang.String
getName()
Deprecated.Obtains the name of the HTTP method as used in the HTTP request line, for example "GET" or "POST".HttpMethodParams
getParams()
Deprecated.ReturnsHTTP protocol parameters
associated with this method.java.lang.String
getPath()
Deprecated.Gets the path of this HTTP method.java.lang.String
getProxyAuthenticationRealm()
Deprecated.use #getProxyAuthState()AuthState
getProxyAuthState()
Deprecated.Returns the proxyauthentication state
java.lang.String
getQueryString()
Deprecated.Gets the query string of this HTTP method.int
getRecoverableExceptionCount()
Deprecated.no longer used Returns the number of "recoverable" exceptions thrown and handled, to allow for monitoring the quality of the connection.java.lang.String
getRequestCharSet()
Deprecated.Returns the character encoding of the request from the Content-Type header.Header
getRequestHeader(java.lang.String headerName)
Deprecated.Returns the specified request header.Header[]
getRequestHeaders()
Deprecated.Returns an array of the requests headers that the HTTP method currently hasHeader[]
getRequestHeaders(java.lang.String headerName)
Deprecated.Returns the request headers with the given name.byte[]
getResponseBody()
Deprecated.Returns the response body of the HTTP method, if any, as an array of bytes.byte[]
getResponseBody(int maxlen)
Deprecated.Returns the response body of the HTTP method, if any, as an array of bytes.java.io.InputStream
getResponseBodyAsStream()
Deprecated.Returns the response body of the HTTP method, if any, as anInputStream
.java.lang.String
getResponseBodyAsString()
Deprecated.Returns the response body of the HTTP method, if any, as aString
.java.lang.String
getResponseBodyAsString(int maxlen)
Deprecated.Returns the response body of the HTTP method, if any, as aString
.java.lang.String
getResponseCharSet()
Deprecated.Returns the character encoding of the response from the Content-Type header.long
getResponseContentLength()
Deprecated.Return the length (in bytes) of the response body, as specified in a Content-Length header.Header
getResponseFooter(java.lang.String footerName)
Deprecated.Gets the response footer associated with the given name.Header[]
getResponseFooters()
Deprecated.Returns an array of the response footers that the HTTP method currently has in the order in which they were read.Header
getResponseHeader(java.lang.String headerName)
Deprecated.Gets the response header associated with the given name.Header[]
getResponseHeaders()
Deprecated.Returns an array of the response headers that the HTTP method currently has in the order in which they were read.Header[]
getResponseHeaders(java.lang.String headerName)
Deprecated.Returns the response headers with the given name.int
getStatusCode()
Deprecated.Returns the response status code.StatusLine
getStatusLine()
Deprecated.Provides access to the response status line.java.lang.String
getStatusText()
Deprecated.Returns the status text (or "reason phrase") associated with the latest response.URI
getURI()
Deprecated.Returns the URI of the HTTP methodboolean
hasBeenUsed()
Deprecated.boolean
isAborted()
Deprecated.Tests whether the execution of this method has been abortedboolean
isHttp11()
Deprecated.boolean
isRequestSent()
Deprecated.Returns true if the HTTP has been transmitted to the target server in its entirety, false otherwise.boolean
isStrictMode()
Deprecated.UseHttpParams.setParameter(String, Object)
to exercise a more granular control over HTTP protocol strictness.void
recycle()
Deprecated.no longer supported and will be removed in the future version of HttpClientvoid
releaseConnection()
Deprecated.Releases the connection being used by this HTTP method.void
removeRequestHeader(java.lang.String headerName)
Deprecated.Remove the request header associated with the given name.void
removeRequestHeader(Header header)
Deprecated.Removes the given request header.void
setDoAuthentication(boolean doAuthentication)
Deprecated.Sets whether or not the HTTP method should automatically handle HTTP authentication challenges (status code 401, etc.)void
setFollowRedirects(boolean followRedirects)
Deprecated.Sets whether or not the HTTP method should automatically follow HTTP redirects (status code 302, etc.)void
setHostConfiguration(HostConfiguration hostconfig)
Deprecated.no longer applicablevoid
setHttp11(boolean http11)
Deprecated.void
setMethodRetryHandler(MethodRetryHandler handler)
Deprecated.useHttpMethodParams
void
setParams(HttpMethodParams params)
Deprecated.AssignsHTTP protocol parameters
for this method.void
setPath(java.lang.String path)
Deprecated.Sets the path of the HTTP method.void
setQueryString(java.lang.String queryString)
Deprecated.Sets the query string of this HTTP method.void
setQueryString(NameValuePair[] params)
Deprecated.Sets the query string of this HTTP method.void
setRequestHeader(java.lang.String headerName, java.lang.String headerValue)
Deprecated.Set the specified request header, overwriting any previous value.void
setRequestHeader(Header header)
Deprecated.Sets the specified request header, overwriting any previous value.void
setStrictMode(boolean strictMode)
Deprecated.UseHttpParams.setParameter(String, Object)
to exercise a more granular control over HTTP protocol strictness.void
setURI(URI uri)
Deprecated.Sets the URI for this method.boolean
validate()
Deprecated.Returns true the method is ready to execute, false otherwise.
-
-
-
Constructor Detail
-
HttpMethodBase
public HttpMethodBase()
Deprecated.No-arg constructor.
-
HttpMethodBase
public HttpMethodBase(java.lang.String uri) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
Deprecated.Constructor specifying a URI. It is responsibility of the caller to ensure that URI elements (path & query parameters) are properly encoded (URL safe).- Parameters:
uri
- either an absolute or relative URI. The URI is expected to be URL-encoded- Throws:
java.lang.IllegalArgumentException
- when URI is invalidjava.lang.IllegalStateException
- when protocol of the absolute URI is not recognised
-
-
Method Detail
-
getName
public abstract java.lang.String getName()
Deprecated.Obtains the name of the HTTP method as used in the HTTP request line, for example "GET" or "POST".- Specified by:
getName
in interfaceHttpMethod
- Returns:
- the name of this method
-
getURI
public URI getURI() throws URIException
Deprecated.Returns the URI of the HTTP method- Specified by:
getURI
in interfaceHttpMethod
- Returns:
- The URI
- Throws:
URIException
- If the URI cannot be created.- See Also:
HttpMethod.getURI()
-
setURI
public void setURI(URI uri) throws URIException
Deprecated.Sets the URI for this method.- Specified by:
setURI
in interfaceHttpMethod
- Parameters:
uri
- URI to be set- Throws:
URIException
- if a URI cannot be set- Since:
- 3.0
-
setFollowRedirects
public void setFollowRedirects(boolean followRedirects)
Deprecated.Sets whether or not the HTTP method should automatically follow HTTP redirects (status code 302, etc.)- Specified by:
setFollowRedirects
in interfaceHttpMethod
- Parameters:
followRedirects
- true if the method will automatically follow redirects, false otherwise.
-
getFollowRedirects
public boolean getFollowRedirects()
Deprecated.Returns true if the HTTP method should automatically follow HTTP redirects (status code 302, etc.), false otherwise.- Specified by:
getFollowRedirects
in interfaceHttpMethod
- Returns:
- true if the method will automatically follow HTTP redirects, false otherwise.
-
setHttp11
public void setHttp11(boolean http11)
Deprecated.Sets whether version 1.1 of the HTTP protocol should be used per default.- Parameters:
http11
- true to use HTTP/1.1, false to use 1.0
-
getDoAuthentication
public boolean getDoAuthentication()
Deprecated.Returns true if the HTTP method should automatically handle HTTP authentication challenges (status code 401, etc.), false otherwise- Specified by:
getDoAuthentication
in interfaceHttpMethod
- Returns:
- true if authentication challenges will be processed automatically, false otherwise.
- Since:
- 2.0
- See Also:
HttpMethod.setDoAuthentication(boolean)
-
setDoAuthentication
public void setDoAuthentication(boolean doAuthentication)
Deprecated.Sets whether or not the HTTP method should automatically handle HTTP authentication challenges (status code 401, etc.)- Specified by:
setDoAuthentication
in interfaceHttpMethod
- Parameters:
doAuthentication
- true to process authentication challenges authomatically, false otherwise.- Since:
- 2.0
- See Also:
HttpMethod.getDoAuthentication()
-
isHttp11
public boolean isHttp11()
Deprecated.Returns true if version 1.1 of the HTTP protocol should be used per default, false if version 1.0 should be used.- Returns:
- true to use HTTP/1.1, false to use 1.0
-
setPath
public void setPath(java.lang.String path)
Deprecated.Sets the path of the HTTP method. It is responsibility of the caller to ensure that the path is properly encoded (URL safe).- Specified by:
setPath
in interfaceHttpMethod
- Parameters:
path
- the path of the HTTP method. The path is expected to be URL-encoded
-
addRequestHeader
public void addRequestHeader(Header header)
Deprecated.Adds the specified request header, NOT overwriting any previous value. Note that header-name matching is case insensitive.- Specified by:
addRequestHeader
in interfaceHttpMethod
- Parameters:
header
- the header to add to the request- See Also:
HttpMethod.addRequestHeader(String,String)
,HttpMethod.getRequestHeader(String)
,HttpMethod.removeRequestHeader(String)
-
addResponseFooter
public void addResponseFooter(Header footer)
Deprecated.Use this method internally to add footers.- Specified by:
addResponseFooter
in interfaceHttpMethod
- Parameters:
footer
- The footer to add.
-
getPath
public java.lang.String getPath()
Deprecated.Gets the path of this HTTP method. Calling this method after the request has been executed will return the actual path, following any redirects automatically handled by this HTTP method.- Specified by:
getPath
in interfaceHttpMethod
- Returns:
- the path to request or "/" if the path is blank.
-
setQueryString
public void setQueryString(java.lang.String queryString)
Deprecated.Sets the query string of this HTTP method. The caller must ensure that the string is properly URL encoded. The query string should not start with the question mark character.- Specified by:
setQueryString
in interfaceHttpMethod
- Parameters:
queryString
- the query string- See Also:
EncodingUtil.formUrlEncode(NameValuePair[], String)
-
setQueryString
public void setQueryString(NameValuePair[] params)
Deprecated.Sets the query string of this HTTP method. The pairs are encoded as UTF-8 characters. To use a different charset the parameters can be encoded manually using EncodingUtil and set as a single String.- Specified by:
setQueryString
in interfaceHttpMethod
- Parameters:
params
- an array ofNameValuePair
s to add as query string parameters. The name/value pairs will be automcatically URL encoded- See Also:
EncodingUtil.formUrlEncode(NameValuePair[], String)
,setQueryString(String)
-
getQueryString
public java.lang.String getQueryString()
Deprecated.Gets the query string of this HTTP method.- Specified by:
getQueryString
in interfaceHttpMethod
- Returns:
- The query string
- See Also:
HttpMethod.setQueryString(NameValuePair[])
,HttpMethod.setQueryString(String)
-
setRequestHeader
public void setRequestHeader(java.lang.String headerName, java.lang.String headerValue)
Deprecated.Set the specified request header, overwriting any previous value. Note that header-name matching is case-insensitive.- Specified by:
setRequestHeader
in interfaceHttpMethod
- Parameters:
headerName
- the header's nameheaderValue
- the header's value- See Also:
HttpMethod.setRequestHeader(Header)
,HttpMethod.getRequestHeader(String)
,HttpMethod.removeRequestHeader(String)
-
setRequestHeader
public void setRequestHeader(Header header)
Deprecated.Sets the specified request header, overwriting any previous value. Note that header-name matching is case insensitive.- Specified by:
setRequestHeader
in interfaceHttpMethod
- Parameters:
header
- the header- See Also:
HttpMethod.setRequestHeader(String,String)
,HttpMethod.getRequestHeader(String)
,HttpMethod.removeRequestHeader(String)
-
getRequestHeader
public Header getRequestHeader(java.lang.String headerName)
Deprecated.Returns the specified request header. Note that header-name matching is case insensitive. null will be returned if either headerName is null or there is no matching header for headerName.- Specified by:
getRequestHeader
in interfaceHttpMethod
- Parameters:
headerName
- The name of the header to be returned.- Returns:
- The specified request header.
- Since:
- 3.0
-
getRequestHeaders
public Header[] getRequestHeaders()
Deprecated.Returns an array of the requests headers that the HTTP method currently has- Specified by:
getRequestHeaders
in interfaceHttpMethod
- Returns:
- an array of my request headers.
- See Also:
HttpMethod.addRequestHeader(Header)
,HttpMethod.addRequestHeader(String,String)
-
getRequestHeaders
public Header[] getRequestHeaders(java.lang.String headerName)
Deprecated.Description copied from interface:HttpMethod
Returns the request headers with the given name. Note that header-name matching is case insensitive.- Specified by:
getRequestHeaders
in interfaceHttpMethod
- Parameters:
headerName
- the name of the headers to be returned.- Returns:
- an array of zero or more headers
- See Also:
HttpMethod.getRequestHeaders(java.lang.String)
-
getResponseHeaders
public Header[] getResponseHeaders(java.lang.String headerName)
Deprecated.Description copied from interface:HttpMethod
Returns the response headers with the given name. Note that header-name matching is case insensitive.- Specified by:
getResponseHeaders
in interfaceHttpMethod
- Parameters:
headerName
- the name of the headers to be returned.- Returns:
- an array of zero or more headers
- Since:
- 3.0
- See Also:
HttpMethod.getResponseHeaders(java.lang.String)
-
getStatusCode
public int getStatusCode()
Deprecated.Returns the response status code.- Specified by:
getStatusCode
in interfaceHttpMethod
- Returns:
- the status code associated with the latest response.
-
getStatusLine
public StatusLine getStatusLine()
Deprecated.Provides access to the response status line.- Specified by:
getStatusLine
in interfaceHttpMethod
- Returns:
- the status line object from the latest response.
- Since:
- 2.0
-
getResponseHeaders
public Header[] getResponseHeaders()
Deprecated.Returns an array of the response headers that the HTTP method currently has in the order in which they were read.- Specified by:
getResponseHeaders
in interfaceHttpMethod
- Returns:
- an array of response headers.
-
getResponseHeader
public Header getResponseHeader(java.lang.String headerName)
Deprecated.Gets the response header associated with the given name. Header name matching is case insensitive. null will be returned if either headerName is null or there is no matching header for headerName.- Specified by:
getResponseHeader
in interfaceHttpMethod
- Parameters:
headerName
- the header name to match- Returns:
- the matching header
-
getResponseContentLength
public long getResponseContentLength()
Deprecated.Return the length (in bytes) of the response body, as specified in a Content-Length header.Return -1 when the content-length is unknown.
- Returns:
- content length, if Content-Length header is available. 0 indicates that the request has no body. If Content-Length header is not present, the method returns -1.
-
getResponseBody
public byte[] getResponseBody() throws java.io.IOException
Deprecated.Returns the response body of the HTTP method, if any, as an array of bytes. If response body is not available or cannot be read, returns null. Buffers the response and this method can be called several times yielding the same result each time. Note: This will cause the entire response body to be buffered in memory. A malicious server may easily exhaust all the VM memory. It is strongly recommended, to use getResponseAsStream if the content length of the response is unknown or resonably large.- Specified by:
getResponseBody
in interfaceHttpMethod
- Returns:
- The response body.
- Throws:
java.io.IOException
- If an I/O (transport) problem occurs while obtaining the response body.
-
getResponseBody
public byte[] getResponseBody(int maxlen) throws java.io.IOException
Deprecated.Returns the response body of the HTTP method, if any, as an array of bytes. If response body is not available or cannot be read, returns null. Buffers the response and this method can be called several times yielding the same result each time. Note: This will cause the entire response body to be buffered in memory. This method is safe if the content length of the response is unknown, because the amount of memory used is limited.If the response is large this method involves lots of array copying and many object allocations, which makes it unsuitable for high-performance / low-footprint applications. Those applications should use
getResponseBodyAsStream()
.- Parameters:
maxlen
- the maximum content length to accept (number of bytes).- Returns:
- The response body.
- Throws:
java.io.IOException
- If an I/O (transport) problem occurs while obtaining the response body.
-
getResponseBodyAsStream
public java.io.InputStream getResponseBodyAsStream() throws java.io.IOException
Deprecated.Returns the response body of the HTTP method, if any, as anInputStream
. If response body is not available, returns null. If the response has been buffered this method returns a new stream object on every call. If the response has not been buffered the returned stream can only be read once.- Specified by:
getResponseBodyAsStream
in interfaceHttpMethod
- Returns:
- The response body or
null
. - Throws:
java.io.IOException
- If an I/O (transport) problem occurs while obtaining the response body.
-
getResponseBodyAsString
public java.lang.String getResponseBodyAsString() throws java.io.IOException
Deprecated.Returns the response body of the HTTP method, if any, as aString
. If response body is not available or cannot be read, returns null The string conversion on the data is done using the character encoding specified in Content-Type header. Buffers the response and this method can be called several times yielding the same result each time. Note: This will cause the entire response body to be buffered in memory. A malicious server may easily exhaust all the VM memory. It is strongly recommended, to use getResponseAsStream if the content length of the response is unknown or resonably large.- Specified by:
getResponseBodyAsString
in interfaceHttpMethod
- Returns:
- The response body or
null
. - Throws:
java.io.IOException
- If an I/O (transport) problem occurs while obtaining the response body.
-
getResponseBodyAsString
public java.lang.String getResponseBodyAsString(int maxlen) throws java.io.IOException
Deprecated.Returns the response body of the HTTP method, if any, as aString
. If response body is not available or cannot be read, returns null The string conversion on the data is done using the character encoding specified in Content-Type header. Buffers the response and this method can be called several times yielding the same result each time. Note: This will cause the entire response body to be buffered in memory. This method is safe if the content length of the response is unknown, because the amount of memory used is limited.If the response is large this method involves lots of array copying and many object allocations, which makes it unsuitable for high-performance / low-footprint applications. Those applications should use
getResponseBodyAsStream()
.- Parameters:
maxlen
- the maximum content length to accept (number of bytes). Note that, depending on the encoding, this is not equal to the number of characters.- Returns:
- The response body or
null
. - Throws:
java.io.IOException
- If an I/O (transport) problem occurs while obtaining the response body.
-
getResponseFooters
public Header[] getResponseFooters()
Deprecated.Returns an array of the response footers that the HTTP method currently has in the order in which they were read.- Specified by:
getResponseFooters
in interfaceHttpMethod
- Returns:
- an array of footers
-
getResponseFooter
public Header getResponseFooter(java.lang.String footerName)
Deprecated.Gets the response footer associated with the given name. Footer name matching is case insensitive. null will be returned if either footerName is null or there is no matching footer for footerName or there are no footers available. If there are multiple footers with the same name, there values will be combined with the ',' separator as specified by RFC2616.- Specified by:
getResponseFooter
in interfaceHttpMethod
- Parameters:
footerName
- the footer name to match- Returns:
- the matching footer
-
getStatusText
public java.lang.String getStatusText()
Deprecated.Returns the status text (or "reason phrase") associated with the latest response.- Specified by:
getStatusText
in interfaceHttpMethod
- Returns:
- The status text.
-
setStrictMode
public void setStrictMode(boolean strictMode)
Deprecated.UseHttpParams.setParameter(String, Object)
to exercise a more granular control over HTTP protocol strictness.Defines how strictly HttpClient follows the HTTP protocol specification (RFC 2616 and other relevant RFCs). In the strict mode HttpClient precisely implements the requirements of the specification, whereas in non-strict mode it attempts to mimic the exact behaviour of commonly used HTTP agents, which many HTTP servers expect.- Specified by:
setStrictMode
in interfaceHttpMethod
- Parameters:
strictMode
- true for strict mode, false otherwise- See Also:
HttpMethod.isStrictMode()
-
isStrictMode
public boolean isStrictMode()
Deprecated.UseHttpParams.setParameter(String, Object)
to exercise a more granular control over HTTP protocol strictness.Description copied from interface:HttpMethod
Returns the value of the strict mode flag.- Specified by:
isStrictMode
in interfaceHttpMethod
- Returns:
- false
- See Also:
HttpMethod.setStrictMode(boolean)
-
addRequestHeader
public void addRequestHeader(java.lang.String headerName, java.lang.String headerValue)
Deprecated.Adds the specified request header, NOT overwriting any previous value. Note that header-name matching is case insensitive.- Specified by:
addRequestHeader
in interfaceHttpMethod
- Parameters:
headerName
- the header's nameheaderValue
- the header's value- See Also:
HttpMethod.addRequestHeader(Header)
,HttpMethod.getRequestHeader(String)
,HttpMethod.removeRequestHeader(String)
-
execute
public int execute(HttpState state, HttpConnection conn) throws HttpException, java.io.IOException
Deprecated.Executes this method using the specifiedHttpConnection
andHttpState
.- Specified by:
execute
in interfaceHttpMethod
- Parameters:
state
-state
information to associate with this request. Must be non-null.conn
- theconnection
to used to execute this HTTP method. Must be non-null.- Returns:
- the integer status code if one was obtained, or -1
- Throws:
java.io.IOException
- if an I/O (transport) error occursHttpException
- if a protocol exception occurs.
-
abort
public void abort()
Deprecated.Aborts the execution of this method.- Specified by:
abort
in interfaceHttpMethod
- Since:
- 3.0
- See Also:
HttpMethod.execute(HttpState, HttpConnection)
-
hasBeenUsed
public boolean hasBeenUsed()
Deprecated.- Specified by:
hasBeenUsed
in interfaceHttpMethod
- Returns:
- true if the method has been executed, false otherwise
-
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:
recycle
in interfaceHttpMethod
- See Also:
releaseConnection()
-
releaseConnection
public void releaseConnection()
Deprecated.Releases the connection being used by this HTTP method. In particular the connection is used to read the response(if there is one) and will be held until the response has been read. If the connection can be reused by other HTTP methods it is NOT closed at this point.- Specified by:
releaseConnection
in interfaceHttpMethod
- Since:
- 2.0
-
removeRequestHeader
public void removeRequestHeader(java.lang.String headerName)
Deprecated.Remove the request header associated with the given name. Note that header-name matching is case insensitive.- Specified by:
removeRequestHeader
in interfaceHttpMethod
- Parameters:
headerName
- the header name
-
removeRequestHeader
public void removeRequestHeader(Header header)
Deprecated.Removes the given request header.- Specified by:
removeRequestHeader
in interfaceHttpMethod
- Parameters:
header
- the header
-
validate
public boolean validate()
Deprecated.Returns true the method is ready to execute, false otherwise.- Specified by:
validate
in interfaceHttpMethod
- Returns:
- This implementation always returns true.
-
getParams
public HttpMethodParams getParams()
Deprecated.ReturnsHTTP protocol parameters
associated with this method.- Specified by:
getParams
in interfaceHttpMethod
- Returns:
- HTTP parameters.
- Since:
- 3.0
- See Also:
HttpMethodParams
-
setParams
public void setParams(HttpMethodParams params)
Deprecated.AssignsHTTP protocol parameters
for this method.- Specified by:
setParams
in interfaceHttpMethod
- Since:
- 3.0
- See Also:
HttpMethodParams
-
getEffectiveVersion
public HttpVersion getEffectiveVersion()
Deprecated.Returns the HTTP version used with this method (may be null if undefined, that is, the method has not been executed)- Returns:
- HTTP version.
- Since:
- 3.0
-
getProxyAuthenticationRealm
public java.lang.String getProxyAuthenticationRealm()
Deprecated.use #getProxyAuthState()Returns proxy authentication realm, if it has been used during authentication process. Otherwise returns null.- Returns:
- proxy authentication realm
-
getAuthenticationRealm
public java.lang.String getAuthenticationRealm()
Deprecated.use #getHostAuthState()Returns authentication realm, if it has been used during authentication process. Otherwise returns null.- Returns:
- authentication realm
-
getRequestCharSet
public java.lang.String getRequestCharSet()
Deprecated.Returns the character encoding of the request from the Content-Type header.- Returns:
- String The character set.
-
getResponseCharSet
public java.lang.String getResponseCharSet()
Deprecated.Returns the character encoding of the response from the Content-Type header.- Returns:
- String The character set.
-
getRecoverableExceptionCount
public int getRecoverableExceptionCount()
Deprecated.no longer used Returns the number of "recoverable" exceptions thrown and handled, to allow for monitoring the quality of the connection.- Returns:
- The number of recoverable exceptions handled by the method.
-
getHostConfiguration
public HostConfiguration getHostConfiguration()
Deprecated.no longer applicableReturns thehost configuration
.- Specified by:
getHostConfiguration
in interfaceHttpMethod
- Returns:
- the host configuration
-
setHostConfiguration
public void setHostConfiguration(HostConfiguration hostconfig)
Deprecated.no longer applicableSets thehost configuration
.- Parameters:
hostconfig
- The hostConfiguration to set
-
getMethodRetryHandler
public MethodRetryHandler getMethodRetryHandler()
Deprecated.useHttpMethodParams
Returns theretry handler
for this HTTP method- Returns:
- the methodRetryHandler
-
setMethodRetryHandler
public void setMethodRetryHandler(MethodRetryHandler handler)
Deprecated.useHttpMethodParams
Sets theretry handler
for this HTTP method- Parameters:
handler
- the methodRetryHandler to use when this method executed
-
getHostAuthState
public AuthState getHostAuthState()
Deprecated.Returns the target hostauthentication state
- Specified by:
getHostAuthState
in interfaceHttpMethod
- Returns:
- host authentication state
- Since:
- 3.0
-
getProxyAuthState
public AuthState getProxyAuthState()
Deprecated.Returns the proxyauthentication state
- Specified by:
getProxyAuthState
in interfaceHttpMethod
- Returns:
- host authentication state
- Since:
- 3.0
-
isAborted
public boolean isAborted()
Deprecated.Tests whether the execution of this method has been aborted- Returns:
- true if the execution of this method has been aborted, false otherwise
- Since:
- 3.0
-
isRequestSent
public boolean isRequestSent()
Deprecated.Returns true if the HTTP has been transmitted to the target server in its entirety, false otherwise. This flag can be useful for recovery logic. If the request has not been transmitted in its entirety, it is safe to retry the failed method.- Specified by:
isRequestSent
in interfaceHttpMethod
- Returns:
- true if the request has been sent, false otherwise
-
-