FileDocCategorySizeDatePackage
HttpOptions.javaAPI DocAndroid 1.5 API3455Wed May 06 22:41:10 BST 2009org.apache.http.client.methods

HttpOptions

public class HttpOptions extends HttpRequestBase
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.

version
$Revision: 664505 $
since
4.0

Fields Summary
public static final String
METHOD_NAME
Constructors Summary
public HttpOptions()

    
      
        super();
    
public HttpOptions(URI uri)

        super();
        setURI(uri);
    
public HttpOptions(String uri)

throws
IllegalArgumentException if the uri is invalid.

        super();
        setURI(URI.create(uri));
    
Methods Summary
public java.util.SetgetAllowedMethods(org.apache.http.HttpResponse response)

        if (response == null) {
            throw new IllegalArgumentException("HTTP response may not be null");
        }
        
        HeaderIterator it = response.headerIterator("Allow");
        Set<String> methods = new HashSet<String>();
        while (it.hasNext()) {
            Header header = it.nextHeader();
            HeaderElement[] elements = header.getElements();
            for (HeaderElement element : elements) {
                methods.add(element.getName());
            }
        }
        return methods;
    
public java.lang.StringgetMethod()

        return METHOD_NAME;