hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Chang <nick.ch...@edge-technologies.com>
Subject Re: Multiple leading slash characters in URI
Date Mon, 07 Jul 2014 21:46:54 GMT
Hello,

Here is a simple code sniplet to reproduce the issue.

    public static void main(String[] args) throws Exception {
        DefaultHttpClient httpclient = new DefaultHttpClient();
        HttpGet httpGet = new HttpGet("http://www.google.com///imghp");

        HttpResponse response1 = httpclient.execute(httpGet);

        try {
            System.out.println(response1.getStatusLine());
            HttpEntity entity1 = response1.getEntity();
            // do something useful with the response body
            // and ensure it is fully consumed
            EntityUtils.consume(entity1);
        } finally {
            httpGet.releaseConnection();
        }

    }

The httpclient library will only send out '/imghp' in the HTTP Request. The
additional leading slash characters are omitted. Anyway to configure
DefaultHttpClient to preserve the additional leading slash characters?

Thanks in advance,

Nick

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message