1

The request URL has stringified json

Sampler Result:
Thread Name: Thread Group 1-1
Sample Start: 2013-09-05 12:09:17 IST
Load time: 0
Latency: 0
Size in bytes: 4491
Headers size in bytes: 0
Body size in bytes: 4491
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Illegal character in query at index 72:

Request:
GET  http://abc.com/api/api_name?XYZModelJsonString={[{},{},{},{},{},{},{},{},{},{},{},{}]{}}
[no cookies]

Response data:
java.net.URISyntaxException: Illegal character in query at index 72: http://abc.com/api/api_name?XYZModelJsonString={[{},{},{},{},{},{},{},{},{},{},{},{}]{}}

at java.net.URI$Parser.fail(Unknown Source)
    at java.net.URI$Parser.checkChars(Unknown Source)
    at java.net.URI$Parser.parseHierarchical(Unknown Source)
    at java.net.URI$Parser.parse(Unknown Source)
    at java.net.URI.<init>(Unknown Source)
    at java.net.URL.toURI(Unknown Source)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:234)
    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(Unknown Source)

1 Answer 1

5

Move the following:

XYZModelJsonString ={[{},{},{},{},{},{},{},{},{},{},{},{}]{}}

In the parameters table putting XYZModelJsonString in name column and the rest in value column and check encode checkbox in the column.

enter image description here It will work

Sign up to request clarification or add additional context in comments.

3 Comments

No. I have tried this but does not work. When I encode I get the following response code. Response code: 500 Response message: Internal Server Error
The URL is as follows: "abc.com/api/api_name?XYZModelJsonString={%22param%22:%22[{\%22param\%22:\%221\%22,\%22param\%22:\%222\%22,\%22param\%22:\%22500.00\%22,\%22param\%22:15000,\%22param\%22:0,\%22param\%22:null,\%22param\%22:true,\%22param\%22:\%22-\%22,\%22param\%22:0}]}"
I edited answer, I tested it and get this : /api/api_name?XYZModelJsonString=%7B%5B%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%5D%7B%7D%7D not what you show

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.