You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Nirodha Pramod <ni...@wso2.com> on 2013/01/28 21:31:00 UTC

Sending JSONP requests with Jmeter

Hi,

I'm having issues when trying to send a JSONP request to a REST service.
I'm sending this get request "
http://localhost:27080/SAPDB/orders/_find?criteria={"ORDER_ID":1} "

and I get the following as the response which is an exception thrown out by
Jmeter. I tried sending them in both "application/x-www-form-urlencoded"
and "application/json" for Content-Type header, but I get the same error.
Can someone please help me with this.

java.net.URISyntaxException: Illegal character in query at index 70:
http://localhost:27080/SAPDB/orders/_find?criteria={"ORDER_ID":1}
at java.net.URI$Parser.fail(URI.java:2827)
at java.net.URI$Parser.checkChars(URI.java:3000)
at java.net.URI$Parser.parseHierarchical(URI.java:3090)
at java.net.URI$Parser.parse(URI.java:3032)
at java.net.URI.<init>(URI.java:595)
at java.net.URL.toURI(URL.java:936)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:227)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1049)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:442)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
at java.lang.Thread.run(Thread.java:722)
-- 
*Nirodha Gallage*
Software Engineer, QA.
WSO2 Inc.: http://wso2.com/
Email: nirodha@wso2.com   Mobile: +94716429078

Re: Sending JSONP requests with Jmeter

Posted by Nirodha Pramod <ni...@wso2.com>.
Hi,

URL encoding resolved the issue. Thanks Deepak.

regards,
Nirodha


On Mon, Jan 28, 2013 at 12:35 PM, Deepak Shetty <sh...@gmail.com> wrote:

> http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
> { or } are unsafe characters and need to be encoded - %7B and %7D
>
>
> On Mon, Jan 28, 2013 at 12:31 PM, Nirodha Pramod <ni...@wso2.com> wrote:
>
> > Hi,
> >
> > I'm having issues when trying to send a JSONP request to a REST service.
> > I'm sending this get request "
> > http://localhost:27080/SAPDB/orders/_find?criteria={"ORDER_ID":1} "
> >
> > and I get the following as the response which is an exception thrown out
> by
> > Jmeter. I tried sending them in both "application/x-www-form-urlencoded"
> > and "application/json" for Content-Type header, but I get the same error.
> > Can someone please help me with this.
> >
> > java.net.URISyntaxException: Illegal character in query at index 70:
> > http://localhost:27080/SAPDB/orders/_find?criteria={"ORDER_ID":1}
> > at java.net.URI$Parser.fail(URI.java:2827)
> > at java.net.URI$Parser.checkChars(URI.java:3000)
> > at java.net.URI$Parser.parseHierarchical(URI.java:3090)
> > at java.net.URI$Parser.parse(URI.java:3032)
> > at java.net.URI.<init>(URI.java:595)
> > at java.net.URL.toURI(URL.java:936)
> > at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:227)
> > at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
> > at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060)
> > at
> >
> >
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1049)
> > at
> >
> >
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:442)
> > at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
> > at java.lang.Thread.run(Thread.java:722)
> > --
> > *Nirodha Gallage*
> > Software Engineer, QA.
> > WSO2 Inc.: http://wso2.com/
> > Email: nirodha@wso2.com   Mobile: +94716429078
> >
>



-- 
*Nirodha Gallage*
Software Engineer, QA.
WSO2 Inc.: http://wso2.com/
Email: nirodha@wso2.com   Mobile: +94716429078

Re: Sending JSONP requests with Jmeter

Posted by Deepak Shetty <sh...@gmail.com>.
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
{ or } are unsafe characters and need to be encoded - %7B and %7D


On Mon, Jan 28, 2013 at 12:31 PM, Nirodha Pramod <ni...@wso2.com> wrote:

> Hi,
>
> I'm having issues when trying to send a JSONP request to a REST service.
> I'm sending this get request "
> http://localhost:27080/SAPDB/orders/_find?criteria={"ORDER_ID":1} "
>
> and I get the following as the response which is an exception thrown out by
> Jmeter. I tried sending them in both "application/x-www-form-urlencoded"
> and "application/json" for Content-Type header, but I get the same error.
> Can someone please help me with this.
>
> java.net.URISyntaxException: Illegal character in query at index 70:
> http://localhost:27080/SAPDB/orders/_find?criteria={"ORDER_ID":1}
> at java.net.URI$Parser.fail(URI.java:2827)
> at java.net.URI$Parser.checkChars(URI.java:3000)
> at java.net.URI$Parser.parseHierarchical(URI.java:3090)
> at java.net.URI$Parser.parse(URI.java:3032)
> at java.net.URI.<init>(URI.java:595)
> at java.net.URL.toURI(URL.java:936)
> at
>
> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:227)
> at
>
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
> at
>
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060)
> at
>
> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1049)
> at
>
> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:442)
> at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
> at java.lang.Thread.run(Thread.java:722)
> --
> *Nirodha Gallage*
> Software Engineer, QA.
> WSO2 Inc.: http://wso2.com/
> Email: nirodha@wso2.com   Mobile: +94716429078
>