hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Mouawad <philippe.moua...@gmail.com>
Subject IllegalArgumentException when URL contains []
Date Sun, 03 Feb 2013 21:24:44 GMT
Hello,
Calling  httpRequest = new HttpGet(uri); with uri equal to:

   - http://example.com/path/to/file[3].html

generates this exception:
java.lang.IllegalArgumentException
    at java.net.URI.create(URI.java:841)
    at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
    at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:249)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
    at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
    at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.net.URISyntaxException: Illegal character in path at index
31: http://example.com/path/to/file[3].html
    at java.net.URI$Parser.fail(URI.java:2810)
    at java.net.URI$Parser.checkChars(URI.java:2983)
    at java.net.URI$Parser.parseHierarchical(URI.java:3067)
    at java.net.URI$Parser.parse(URI.java:3015)
    at java.net.URI.<init>(URI.java:577)
    at java.net.URI.create(URI.java:839)
    ... 8 more


Are we supposed to encode this kind of URLs or is it some bug ?

Regards
Philippe

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