Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.OptionsMethod


        } else if (method.equalsIgnoreCase("delete")) {
            return new DeleteMethod(uri);
        } else if (method.equalsIgnoreCase("head")) {
            return new HeadMethod(uri);
        } else if (method.equalsIgnoreCase("options")) {
            return new OptionsMethod(uri);
        } else {
            // throw new AuthenticationException("unsupported http method : " + method);
            return new MethodHelper.ExtensionMethod(method, uri);
        }
    }
View Full Code Here


        {
            writeResponse(context);
        }
        else if (ProxyConstants.METHOD_OPTIONS.equals(method))
        {
            OptionsMethod optionsMethod = (OptionsMethod)httpMethod;
            Enumeration options = optionsMethod.getAllowedMethods();
            if (options != null)
            {
                List ops = new ArrayList();
                while (options.hasMoreElements())
                {
View Full Code Here

            PutMethod putMethod = new PutMethod(encodedPath);
            context.setHttpMethod(putMethod);
        }
        else if (ProxyConstants.METHOD_OPTIONS.equals(method))
        {
            OptionsMethod optionsMethod = new OptionsMethod(encodedPath);
            context.setHttpMethod(optionsMethod);
        }
        else if (ProxyConstants.METHOD_DELETE.equals(method))
        {
            DeleteMethod deleteMethod = new DeleteMethod(encodedPath);
View Full Code Here

            } else if (method.equalsIgnoreCase(Method.CONNECT.getName())) {
                final HostConfiguration host = new HostConfiguration();
                host.setHost(new URI(requestUri, false));
                this.httpMethod = new ConnectMethod(host);
            } else if (method.equalsIgnoreCase(Method.OPTIONS.getName())) {
                this.httpMethod = new OptionsMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.TRACE.getName())) {
                this.httpMethod = new TraceMethod(requestUri);
            } else {
                this.httpMethod = new EntityEnclosingMethod(requestUri) {
                    @Override
View Full Code Here

            } else if (method.equals(HTTPConstants.HEAD)){
                httpMethod = new HeadMethod(urlStr);
            } else if (method.equals(HTTPConstants.TRACE)){
                httpMethod = new TraceMethod(urlStr);
            } else if (method.equals(HTTPConstants.OPTIONS)){
                httpMethod = new OptionsMethod(urlStr);
            } else if (method.equals(HTTPConstants.DELETE)){
                httpMethod = new DeleteMethod(urlStr);
            } else if (method.equals(HTTPConstants.GET)){
                httpMethod = new GetMethod(urlStr);
            } else if (method.equals(HTTPConstants.PATCH)){
View Full Code Here

            } else if (method.equalsIgnoreCase(Method.CONNECT.getName())) {
                final HostConfiguration host = new HostConfiguration();
                host.setHost(new URI(requestUri, false));
                this.httpMethod = new ConnectMethod(host);
            } else if (method.equalsIgnoreCase(Method.OPTIONS.getName())) {
                this.httpMethod = new OptionsMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.TRACE.getName())) {
                this.httpMethod = new TraceMethod(requestUri);
            } else {
                this.httpMethod = new EntityEnclosingMethod(requestUri) {
                    @Override
View Full Code Here

                break;
            case HEAD:
                httpMethod = new HeadMethod(uri);
                break;
            case OPTIONS:
                httpMethod = new OptionsMethod(uri);
                break;
            case TRACE:
                httpMethod = new TraceMethod(uri);
                break;
            default:
View Full Code Here

        //get the persist state
        boolean       persistState    = args[1].effectiveBooleanValue();

        //setup OPTIONS request
        OptionsMethod options        = new OptionsMethod( url );

        //setup OPTIONS Request Headers
        if( !args[2].isEmpty() ) {
            setHeaders( options, ( ( NodeValue )args[2].itemAt( 0 ) ).getNode() );
        }

        try {

            //execute the request
            response = doRequest(context, options, persistState, null, null);
        }
        catch( IOException ioe ) {
            throw(new XPathException(this, ioe.getMessage(), ioe));
        }
        finally {
            options.releaseConnection();
        }

        return( response );
    }
View Full Code Here

      } else if (method.equals(HEAD)){
          httpMethod = new HeadMethod(urlStr);
      } else if (method.equals(TRACE)){
          httpMethod = new TraceMethod(urlStr);
      } else if (method.equals(OPTIONS)){
          httpMethod = new OptionsMethod(urlStr);
      } else if (method.equals(DELETE)){
          httpMethod = new DeleteMethod(urlStr);
      } else if (method.equals(GET)){
          httpMethod = new GetMethod(urlStr);
      } else {
View Full Code Here

    }

    @Test
    public void testOptions() throws Exception
    {
        OptionsMethod method = new OptionsMethod(getHttpEndpointAddress());
        int statusCode = client.executeMethod(method);
        assertEquals(HttpStatus.SC_OK, statusCode);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.methods.OptionsMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.