Package org.apache.commons.httpclient.params

Examples of org.apache.commons.httpclient.params.HttpParams


        return response.toString();
    }

    public InputStream executeCometRequest(String url) throws Exception {
        HttpClient httpClient = HttpClientHelper.createClient(this.beesClientConfiguration);
        HttpParams params = httpClient.getParams();
        params.setIntParameter(HttpConnectionParams.SO_TIMEOUT, 0);
        GetMethod getMethod = new GetMethod(url);
        int code = httpClient.executeMethod(getMethod);
        if (code >= 300) {
            processError(getResponseString(getMethod.getResponseBodyAsStream()), code);
        }
View Full Code Here


        return response.toString();
    }

    public InputStream executeCometRequest(String url) throws Exception {
        HttpClient httpClient = HttpClientHelper.createClient(this.beesClientConfiguration);
        HttpParams params = httpClient.getParams();
        params.setIntParameter(HttpConnectionParams.SO_TIMEOUT, 0);
        GetMethod getMethod = new GetMethod(url);
        int code = httpClient.executeMethod(getMethod);
        if (code >= 300) {
            processError(getResponseString(getMethod.getResponseBodyAsStream()), code);
        }
View Full Code Here

    public void testChallengeSelection() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.DIGEST);
        authPrefs.add(AuthPolicy.BASIC);
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unknown", "unknown realm=\"whatever\"");
View Full Code Here

    public void testInvalidChallenge() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add("unsupported1");
        authPrefs.add("unsupported2");
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unsupported1", "unsupported1 realm=\"whatever\"");
View Full Code Here

    public void testUnsupportedChallenge() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.BASIC);
        authPrefs.add(AuthPolicy.DIGEST);
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unsupported1", "unsupported1 realm=\"whatever\"");
View Full Code Here

            //expected
        }
    }

    public void testChallengeProcessing() throws Exception {
        HttpParams httpparams = new DefaultHttpParams();
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("basic", "basic realm=\"whatever\", param=\"value\"");
       
View Full Code Here

        assertEquals(authscheme, authstate.getAuthScheme());
        assertEquals("value", authscheme.getParameter("param"));
    }

    public void testInvalidChallengeProcessing() throws Exception {
        HttpParams httpparams = new DefaultHttpParams();
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("basic", "basic realm=\"whatever\", param=\"value\"");
       
View Full Code Here

        // include the scheme in the AuthPolicy.AUTH_SCHEME_PRIORITY preference
        ArrayList schemes = new ArrayList();
        schemes.add("Negotiate");

        HttpParams params = DefaultHttpParams.getDefaultParams();       
        params.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, schemes);
       
        // now that our scheme has been registered we can execute methods against
        // servers that require "Negotiate" authentication...
        HttpClient client = new HttpClient();
       
View Full Code Here

        }
    }

    private void checkDate(String date) throws Exception {
        Header header = new Header("Set-Cookie", "custno=12345;Expires='"+date+"';");
        HttpParams params = new DefaultHttpParamsFactory().getDefaultParams();
        CookieSpec cookiespec = new CookieSpecBase();
        cookiespec.setValidDateFormats(
            (Collection)params.getParameter(HttpMethodParams.DATE_PATTERNS));
        cookieParse(cookiespec, "localhost", 80, "/", false, header);
    }
View Full Code Here

    public void testChallengeSelection() throws Exception {
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.DIGEST);
        authPrefs.add(AuthPolicy.BASIC);
        HttpParams httpparams = new DefaultHttpParams();
        httpparams.setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
       
        AuthChallengeProcessor processor = new AuthChallengeProcessor(httpparams);

        Map map = new HashMap();
        map.put("unknown", "unknown realm=\"whatever\"");
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.params.HttpParams

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.