hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thandra, Kiran" <Extern.Kiran.Than...@vw.com>
Subject RE: Slide and Jakarta-commons-httpClient
Date Tue, 10 Dec 2002 20:29:15 GMT
How do i defalut the acceptance of cookies based on trust .

-----Original Message-----
From: Kalnichevski, Oleg [mailto:oleg.kalnichevski@bearingpoint.com]
Sent: Tuesday, December 10, 2002 3:23 PM
To: Commons HttpClient Project
Subject: RE: Slide and Jakarta-commons-httpClient


Thandra,

If you are absolutely positive that you need to hit that URL with HTTP POST,
that is how it should be

        HttpClient client = new HttpClient();
        client.getHostConfiguration().setHost("xyz.abc.com", 80, "http");
        PostMethod method = new PostMethod("/verifyuser.asp");
        method.setUseDisk(false);
        method.addParameter("language", "2");
        method.addParameter("trlrd", "jgjnbgjn");
        method.addParameter("password", "MI9970");
        method.setRequestContentLength(PostMethod.CONTENT_LENGTH_AUTO);
        try
        {
            client.executeMethod(method);
        } 
        catch (Exception e) {
            e.printStackTrace();
            fail("Unexpected exception: " + e.toString());
        }
        System.out.println(method.getResponseBodyAsString());
        assertEquals(200,method.getStatusCode());

Hope that helps

Oleg

--
To unsubscribe, e-mail:
<mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-httpclient-dev-help@jakarta.apache.org>

Mime
View raw message