Class OptionsMethod
java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
org.apache.commons.httpclient.methods.OptionsMethod
- All Implemented Interfaces:
HttpMethod
Implements the HTTP OPTIONS method.
The HTTP OPTIONS method is defined in section 9.2 of RFC2616:
The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
- Since:
- 1.0
- Version:
- $Revision: 480424 $
- Author:
- Remy Maucherat, Mike Bowler, Jeff Dever
-
Field Summary
Fields inherited from class HttpMethodBase
effectiveVersion, statusLine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a list of allowed methods.getName()Get the name.booleanIs the specified method allowed ?booleanDeprecated.only entity enclosing methods set content length headerprotected voidprocessResponseHeaders(HttpState state, HttpConnection conn) This implementation will parse the Allow header to obtain the set of methods supported by the resource identified by the Request-URI.Methods inherited from class HttpMethodBase
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, 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, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, recycle, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestBody, writeRequestHeaders, writeRequestLine
-
Constructor Details
-
OptionsMethod
public OptionsMethod()Method constructor.- Since:
- 1.0
-
OptionsMethod
Constructor specifying a URI.- Parameters:
uri- either an absolute or relative URI- Since:
- 1.0
-
-
Method Details
-
getName
Get the name.- Specified by:
getNamein interfaceHttpMethod- Specified by:
getNamein classHttpMethodBase- Returns:
- "OPTIONS"
- Since:
- 2.0
-
isAllowed
Is the specified method allowed ?- Parameters:
method- The method to check.- Returns:
- true if the specified method is allowed.
- Since:
- 1.0
-
getAllowedMethods
Get a list of allowed methods.- Returns:
- An enumeration of all the allowed methods.
- Since:
- 1.0
-
processResponseHeaders
This implementation will parse the Allow header to obtain the set of methods supported by the resource identified by the Request-URI.
- Overrides:
processResponseHeadersin classHttpMethodBase- Parameters:
state- thestateinformation associated with this methodconn- theconnectionused to execute this HTTP method- Since:
- 2.0
- See Also:
-
needContentLength
public boolean needContentLength()Deprecated.only entity enclosing methods set content length headerReturn true if the method needs a content-length header in the request.- Returns:
- true if a content-length header will be expected by the server
- Since:
- 1.0
-