Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 43084 invoked from network); 4 Mar 2010 13:45:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Mar 2010 13:45:45 -0000 Received: (qmail 69948 invoked by uid 500); 4 Mar 2010 13:45:35 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 69930 invoked by uid 500); 4 Mar 2010 13:45:35 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 69922 invoked by uid 99); 4 Mar 2010 13:45:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 13:45:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ernst@synquad.nl designates 82.129.34.253 as permitted sender) Received: from [82.129.34.253] (HELO zm2.synquad.nl) (82.129.34.253) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 13:45:24 +0000 Received: from localhost (localhost [127.0.0.1]) by zm2.synquad.nl (Postfix) with ESMTP id 531436AB34 for ; Thu, 4 Mar 2010 14:45:01 +0100 (CET) X-Virus-Scanned: amavisd-new at X-Spam-Score: -2.68 X-Spam-Level: Received: from zm2.synquad.nl ([127.0.0.1]) by localhost (zm2.synquad.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gtQJPoQDwYyd for ; Thu, 4 Mar 2010 14:45:00 +0100 (CET) Received: from [192.168.1.74] (synquadoffice.xs4all.nl [62.251.25.46]) by zm2.synquad.nl (Postfix) with ESMTP id 2052E6AB1C for ; Thu, 4 Mar 2010 14:45:00 +0100 (CET) Message-Id: <924F9548-CD02-4081-BDB3-5D0D8B5011E6@synquad.nl> From: Ernst Nolte To: "HttpClient User Discussion" In-Reply-To: <399DA4AB3471814AA1A85085EC6B4E33047C65B0@nasa-dtw-ex005.nasa.cpwr.corp> Content-Type: multipart/alternative; boundary=Apple-Mail-160--507189928 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: responding to form login fields Date: Thu, 4 Mar 2010 14:45:02 +0100 References: <399DA4AB3471814AA1A85085EC6B4E33047C65B0@nasa-dtw-ex005.nasa.cpwr.corp> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Flag: NO X-Old-Spam-Status: No, score=-2.68 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, AWL=-1.470, BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188, HTML_MESSAGE=0.001] --Apple-Mail-160--507189928 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Jim I assume you use HttpClient v4? If you look at the form action attribute in the page you will see this:
So you need to post the parameters to this url: http://www.gomeznetworks.com/login.asp and set the fields like this: HttpPost post = new HttpPost(url); List vals = new ArrayList(); vals.add(new BasicNameValuePair("username", "you")); vals.add(new BasicNameValuePair("pwd", "passwd")); post.setEntity(new UrlEncodedFormEntity(vals, HTTP.UTF_8)); and now execute it. as far as the input type image is concerned, I think the onclick event of image is captured bij Javascript event attachment and in that handler the form is posted, but I did not bother to verify that. Met Vriendelijke groet/Kind regards, Ernst Nolte Email: ernst@synquad.nl Website: http://www.synquad.nl Office: Zwarteweg 6-D, 1412GD, Naarden Tel: +31(0)35 698 11 55 Fax: +31(0)35 698 27 42 Mob: +31(0)6 813 287 75 On 4 Mar 2010, at 13:55, Langston, James wrote: > Hi all, > > After tons of look up - I haven't been able to find a good example of > being able > to correctly respond to a login form that is using an type="image" to > initiate the login > process. The fields in the html are: > > > > Username:
> type="text" size="30" maxlength="60" name="username">
> > Password:
> type="password" size="30" maxlength="60" name="pwd">  > type="image" src="images/buttons/submit_gray.gif > > " name="login" align="absmiddle"> > > type="hidden" name="server_string" value=""> > type="hidden" name="url_string" value=""> > type="hidden" name="query_string" value=""> > type="hidden" name="form_string" value=""> > > > and I need to respond to username, password and login. I do not > understand how to create the NameValuePair to respond to the > image in order to submit the login and move to the next page in the > sequence. > > Any thoughts, hints ? > > Thanks, > > Jim > > ////////////////////////////////////////// > > > > Jim Langston > Technical Consultant > james.langston@compuware.com > > The contents of this e-mail are intended for the named addressee > only. It contains information that may be confidential. Unless you > are the named addressee or an authorized designee, you may not copy > or use it, or disclose it to anyone else. If you received it in > error please notify us immediately and then destroy it. > --Apple-Mail-160--507189928--