java.net.uri 异常,java.net.URISyntaxException:索引72处查询中的非法字符

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.(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)

解决方案

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.

t7K7o.png

It will work

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值