org.apache.commons.httpclient.methods
Class OptionsMethod

java.lang.Object
  |
  +--org.apache.commons.httpclient.HttpMethodBase
        |
        +--org.apache.commons.httpclient.methods.OptionsMethod
All Implemented Interfaces:
HttpMethod
Direct Known Subclasses:
UrlOptionsMethod

public class OptionsMethod
extends HttpMethodBase

OPTIONS Method.

Since:
1.0
Author:
Remy Maucherat

Field Summary
 
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Constructor Summary
OptionsMethod()
          Method constructor.
OptionsMethod(java.lang.String uri)
          Constructor specifying a URI.
 
Method Summary
 java.util.Enumeration getAllowedMethods()
          Get a list of allowed methods.
 java.lang.String getName()
          Obtain the name of this method, suitable for use in the "request line", for example GET or POST.
 boolean isAllowed(java.lang.String method)
          Is the specified method allowed ?
 boolean needContentLength()
          Return true if the method needs a content-length header in the request.
protected  void processResponseHeaders(HttpState state, HttpConnection conn)
          When this method is invoked, the response headers map will have been populated with the response headers (in other words, readResponseHeaders(HttpState,HttpConnection) will have been invoked).
 
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getContentCharSet, getDoAuthentication, getFollowRedirects, getHostConfiguration, getPath, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestContentLength, getRequestHeader, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaders, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isHttp11, isStrictMode, processResponseBody, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, recycle, releaseConnection, removeRequestHeader, responseBodyConsumed, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, shouldCloseConnection, validate, writeRequest, writeRequestBody, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionsMethod

public OptionsMethod()
Method constructor.

Since:
1.0

OptionsMethod

public OptionsMethod(java.lang.String uri)
Constructor specifying a URI.

Parameters:
uri - either an absolute or relative URI
Since:
1.0
Method Detail

getName

public java.lang.String getName()
Description copied from class: HttpMethodBase
Obtain the name of this method, suitable for use in the "request line", for example GET or POST.

Specified by:
getName in interface HttpMethod
Specified by:
getName in class HttpMethodBase
Returns:
the name of this method
Since:
2.0

isAllowed

public boolean isAllowed(java.lang.String method)
Is the specified method allowed ?

Since:
1.0

getAllowedMethods

public java.util.Enumeration getAllowedMethods()
Get a list of allowed methods.

Since:
1.0

processResponseHeaders

protected void processResponseHeaders(HttpState state,
                                      HttpConnection conn)
Description copied from class: HttpMethodBase
When this method is invoked, the response headers map will have been populated with the response headers (in other words, readResponseHeaders(HttpState,HttpConnection) will have been invoked).

This implementation will handle the Set-Cookie and Set-Cookie2 headers, if any, adding the relevant cookies to the given HttpState.

Subclasses may want to override this method to specially process additional headers, and/or invoke this method (via super) to process the Set-Cookie and Set-Cookie2 headers.

Overrides:
processResponseHeaders in class HttpMethodBase
Parameters:
state - the client state
conn - the HttpConnection to read the response from
Since:
2.0
See Also:
HttpMethodBase.readResponse(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpConnection), HttpMethodBase.readResponseHeaders(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpConnection)

needContentLength

public boolean needContentLength()
Return 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


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.