Package org.apache.http

Examples of org.apache.http.MethodNotSupportedException


    protected void validate(final HttpRequest request,
            final String[] methods) throws MethodNotSupportedException {
        final String method = request.getRequestLine().getMethod().toUpperCase(
                Locale.ENGLISH);
        if(!CollectionUtils.contains(methods, method)){
            throw new MethodNotSupportedException(method + " method not supported");
        }
    }
View Full Code Here


            final HttpContext context) throws HttpException, IOException {
        super.onLog(Level.FINE, "Handlig Class: " + this.getClass().getName());
        //-- check method --//
        final String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
        if (!method.equals("GET")) {
            throw new MethodNotSupportedException(method + " method not supported");
        }

        final String target = request.getRequestLine().getUri();
        final WebUri uri = new WebUri(target);
        final String password = uri.getQueryParamAsString(REQ_PARAM_PASSWORD);
View Full Code Here

            final HttpContext context) throws HttpException, IOException {
        super.onLog(Level.FINE, "Handlig Class: " + this.getClass().getName());
        //-- check method --//
        final String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
        if (!method.equals("GET")) {
            throw new MethodNotSupportedException(method + " method not supported");
        }

        final WebContext webcontext = new WebContext(request, response, context);
        final String target = request.getRequestLine().getUri();
        final WebUri uri = new WebUri(target);
View Full Code Here

        super.onLog(Level.FINE, "Handlig Class: " + this.getClass().getName());

        String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
        if (!method.equals("GET") && !method.equals("HEAD") && !method.equals("POST")) {
            throw new MethodNotSupportedException(method + " method not supported");
        }

        if (request instanceof HttpEntityEnclosingRequest) {
            HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
View Full Code Here

                    msgContext,
                    response.getOutputStream(),
                    null);

        } else {
            throw new MethodNotSupportedException(method + " method not supported");
        }
       
        Boolean holdResponse =
            (Boolean) msgContext.getProperty(RequestResponseTransport.HOLD_RESPONSE);
        if (pi.equals(InvocationResponse.SUSPEND) ||
View Full Code Here

        } else if ("HEAD".equalsIgnoreCase(method)) {
            return new BasicHttpRequest(requestline);
        } else if ("POST".equalsIgnoreCase(method)) {
            return new BasicHttpEntityEnclosingRequest(requestline);
        } else {
            throw new MethodNotSupportedException(method +  " method not supported");
        }
    }
View Full Code Here

    if ("GET".equalsIgnoreCase(method)) {
      return new BasicHttpRequest(method, uri);
    } else if ("POST".equalsIgnoreCase(method)) {
      return new BasicHttpEntityEnclosingRequest(method, uri);
    } else {
      throw new MethodNotSupportedException(method
          + " method not supported");
    }
    }
View Full Code Here

                    msgContext,
                    response.getOutputStream(),
                    null);

        } else {
            throw new MethodNotSupportedException(method + " method not supported");
        }
       
        Boolean holdResponse =
            (Boolean) msgContext.getProperty(RequestResponseTransport.HOLD_RESPONSE);
        if (pi.equals(InvocationResponse.SUSPEND) ||
View Full Code Here

            final HttpResponse response,
            final NHttpResponseTrigger trigger,
            final HttpContext context) throws HttpException, IOException {
        String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
        if (!method.equals("GET") && !method.equals("HEAD") && !method.equals("POST")) {
            throw new MethodNotSupportedException(method + " method not supported");
        }
        if (request instanceof HttpEntityEnclosingRequest) {
            HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
            entity.consumeContent();
        }
View Full Code Here

            final HttpRequest request,
            final HttpResponse response,
            final HttpContext context) throws HttpException, IOException {
        String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
        if (!method.equals("GET") && !method.equals("HEAD") && !method.equals("POST")) {
            throw new MethodNotSupportedException(method + " method not supported");
        }
        if (request instanceof HttpEntityEnclosingRequest) {
            HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
            entity.consumeContent();
        }
View Full Code Here

TOP

Related Classes of org.apache.http.MethodNotSupportedException

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.