Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 85356 invoked from network); 9 Jun 2004 04:04:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Jun 2004 04:04:53 -0000 Received: (qmail 66647 invoked by uid 500); 9 Jun 2004 04:05:05 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 66620 invoked by uid 500); 9 Jun 2004 04:05:04 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 66520 invoked by uid 99); 9 Jun 2004 04:04:59 -0000 Received: from [140.142.32.135] (HELO mxout5.cac.washington.edu) (140.142.32.135) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 08 Jun 2004 21:04:57 -0700 Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9]) by mxout5.cac.washington.edu (8.12.11+UW04.02/8.12.11+UW04.03) with ESMTP id i5944FEq017250 for ; Tue, 8 Jun 2004 21:04:15 -0700 Received: from [10.0.1.2] (pool-68-160-41-80.bos.east.verizon.net [68.160.41.80]) (authenticated bits=0) by smtp.washington.edu (8.12.11+UW04.02/8.12.11+UW04.03) with ESMTP id i5944Dls003325 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 8 Jun 2004 21:04:15 -0700 Mime-Version: 1.0 (Apple Message framework v618) In-Reply-To: <40C64EE2.4090000@bancbridge.com> References: <40C64EE2.4090000@bancbridge.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0CA08F52-B9CA-11D8-AFBB-00306557E112@u.washington.edu> Content-Transfer-Encoding: 7bit From: Michael Becke Subject: Re: [HttpClient] org.apache.commons.httpclient.URIException: escaped query not valid Date: Wed, 9 Jun 2004 00:04:05 -0400 To: "Jakarta Commons Users List" X-Mailer: Apple Mail (2.618) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Kedar, The problem is with the '[' and ']' characters. These are not allowed unescaped. Mike On Jun 8, 2004, at 7:42 PM, Kedar Panse wrote: > I was just playing around with HttpClient. Getting escaped query not > valid Exception while trying to get > /1086729248/smgetcred.cgi? > TYPE=16777244&REALM=$SM$Protect%20%2ftools%2fgbib%2flaunchService%2esht > ml%20[17%3a14%3a08%3a1939]&TARGET=$SM$http%3a%2f%2fwww1%2enet%2emysite% > 2ecom%2fcode%2fpro%2ftools%2fgbib%2flaunchService%2ejhtml%3b$$sessionid > $$UJ5SVZC3YIMPNQFIOEQCFFGAVCZB4IV0%3fLineNumber%3d0 > > With java.net.URI it doesn't give me any problem > > any ideas?? > > Kedar > > > > > import org.apache.commons.httpclient.*; > import org.apache.commons.logging.*; > import org.apache.commons.httpclient.methods.*; > > public class HTTPCtest{ > public static void main(String[] argv){ > try{ > HttpClient client = new HttpClient(); > java.net.URI > u=java.net.URI.create("/1086729248/smgetcred.cgi? > TYPE=16777244&REALM=$SM$Protect%20%2ftools%2fgbib%2flaunchService%2esht > ml%20[17%3a14%3a08%3a1939]&TARGET=$SM$http%3a%2f%2fwww1%2enet%2emysite% > 2ecom%2fcode%2fpro%2ftools%2fgbib%2flaunchService%2ejhtml%3b$$sessionid > $$UJ5SVZC3YIMPNQFIOEQCFFGAVCZB4IV0%3fLineNumber%3d0"); > String urn=u.getRawPath()+"?"+u.getRawQuery(); > System.out.println(urn); > HttpMethod method = new > GetMethod("http://www.mysite.com"+urn); > client.execute(method); > String _uri=method.getURI().getPathQuery(); > System.out.println("URI is "+_uri); > }catch(Exception e){ > e.printStackTrace(); > } > } > } > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org