无法在Jmeter中将Json参数作为GET请求的一部分发送

时间:2014-10-15 13:34:01

标签: jmeter

我正在使用Jmeter来加载100个用户的测试

这是使用GET的REST调用

作为我的请求的一部分,我发送3个参数

  1. ordersplitjson

  2. CUSTOMER_ID

  3. homedelivery

  4. ordersplitjson参数是JSON值(有点大)

    这是从浏览器捕获的请求,直接粘贴在浏览器中时也是如此

    http:/localhost:8080/OMS/oms1/orderinsertservice?ordersplitjson={"highPriceVendor":"VC4%20Raj","vendors":{"T1":[{"item_ids_":"194","contact_phone_no_":"9876543210","name":"VC4%20Raj","contact_address":"Kukatpally,%20Hyderabad","leaf":[{"contact_phone_no":"9876543210","SurCharges":"50","vendorname":"VC4%20Raj","count":"0","contact_email":"rajk@gmail.com","discount_div":"10Rs","itemid":"194","strikeprice_cutoff":"110","name":"Popcorn%20Regular%20%20%20300%20ML%20Fountain%20Apple","quantity":"1","contact_address":"Kukatpally,%20Hyderabad","date_time":"18:10:19","email_id":"raj@hmail.com","toppings":[],"screen":"SCR-3","seat_num":"D12","customer_name":"Ganesh","image":"images/icon-print.png","contact_person":"Kiran","item_description":"Item%20description","vendor_id":"9","crusts":[],"Vat":"70","customer_mobil":"9090987878","price":"100","mobile_number":"1234567898","ServicesCharges":"50","orderid":"14101519"}],"vendor_id":"9"}]}}&customer_id=22&homedelivery=Yes
    

    但在Jmeter下,我总是收到错误

    java.net.URISyntaxException: Illegal character in query at index 64: 
    

    这些是我的屏幕截图

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

您的HTTP采样器设置& HTTP标头设置应与下面附带的图片相同

HTTP Sampler

HTTP Header

希望这会有所帮助。