commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kedar Panse <ke...@bancbridge.com>
Subject [HttpClient] org.apache.commons.httpclient.URIException: escaped query not valid
Date Tue, 08 Jun 2004 23:42:26 GMT
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%2eshtml%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%2eshtml%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


Mime
View raw message