1. 程式人生 > >Jmeter 參數未編碼異常:java.net.URISyntaxException: Illegal character in query at index 172

Jmeter 參數未編碼異常:java.net.URISyntaxException: Illegal character in query at index 172

dex ons 解決方法 kit bubuko discuz 發送請求 lan 分享圖片

最近在使用jmeter進行測試時,每次回放時,都回放失敗,查看response data 提示:java.net.URISyntaxException: Illegal character in query at index 172 的異常信息。如下:

java.net.URISyntaxException: Illegal character in query at index 172: http://www.xxxx.com/discuz/images/default/right_big.gif?

Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8&Accept-Encoding=gzip, deflate, br&Accept-Language=zh-CN%2Czh%3Bq%3D0.9&User-Agent=Mozilla%2F5.0+%28Windows+NT+6.1%3B+WOW64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F63.0.3239.132+Safari%2F537.36&pO5_auth=a7d6J%2FoHPxe6UU9y6yFwV8R0WOiULiyRs8HKRwtiwdG3Za46e3H0TJySLFHtL3NLqsW4k%2FepaHLkIFGA7kNsr2w

技術分享圖片

仔細查看參數,發現請求的參數都是以明碼的形式發送。

解決方法:在將勾選參數後面的:encode(先編碼在發送請求)

技術分享圖片

再次運行,即可運行通過,如下圖:

技術分享圖片

Jmeter 參數未編碼異常:java.net.URISyntaxException: Illegal character in query at index 172