我有一个脚本,在我的请求中,我使用:
"requirements": [
{
"key": "SITEID",
"operand": "%",
"value": "1,202,209"
}
]
我遇到了一些例外:
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "","
at java.net.URLDecoder.decode(URLDecoder.java:232) ~[?:?]
at java.net.URLDecoder.decode(URLDecoder.java:142) ~[?:?]
at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.decodeQuery(RequestViewHTTP.java:336) ~[ApacheJMeter_http.jar:5.4.3]
at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.getQueryMap(RequestViewHTTP.java:290) ~[ApacheJMeter_http.jar:5.4.3]
at org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.setSamplerResult(RequestViewHTTP.java:216) ~[ApacheJMeter_http.jar:5.4.3]
at org.apache.jmeter.visualizers.RequestPanel.setSamplerResult(RequestPanel.java:116) ~[ApacheJMeter_components.jar:5.4.3]
at org.apache.jmeter.visualizers.SamplerResultTab.setupTabPane(SamplerResultTab.java:238) ~[ApacheJMeter_components.jar:5.4.3]
at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:385) ~[ApacheJMeter_components.jar:5.4.3]
at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:363) ~[ApacheJMeter_components.jar:5.4.3]
at javax.swing.JTree.fireValueChanged(JTree.java:2967) ~[?:?]
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3456) ~[?:?]
为了避开%符号,应该做些什么?
1条答案
按热度按时间tjvv9vkg1#
1.如果您使用“参数”部分-勾选“URL编码”框
1.如果您直接将JSON添加到URL-将其 Package 到__urlencode()函数中,如下所示:
1.请确保您确实需要使用HTTP GET方法,因为请求主体看起来更像是POST方法
1.您可能还需要添加一个HTTP Header Manager,并将其配置为发送值为
application/json
的Content-Type标头