Jmeter HTTP request java.net.URISyntaxException: Illegal character in query at index 71

不打扰是莪最后的温柔 提交于 2019-12-11 11:46:18

问题


It's the first time I'm encountering this error for HTTP request (POST).

I'm trying to do a simple post request, not sure why it doesn't work using the Jmeter.

please help :-)


URL:

https://connect-qa.bglobale.com:4453/Checkout/SendCart?shippingDetails={"CountryCode":"LI"}&clientIP=79.120.71.29&priceCoefficientRate=1&includeVAT=0&discountsList={"DiscountValue":29.028122604,"OriginalDiscountValue":122.838,"Name":"Cart Discount","DiscountType":1,"VATRate":18}&merchantCartToken=1294&currencyCode=CHF&originalCurrencyCode=ILS&cultureCode=en-GB&preferedCultureCode=en_US&shippingOptionsList={"Carrier":"flatrate","CarrierTitle":"Flat Rate","CarrierName":"Flat Rate","Code":"flatrate_flatrate","Method":"flatrate","MethodTitle":"Fixed","MethodDescription":null,"Price":0}&hubId=1&merchantGUID=0f4eec24-8988-4361-be9a-a7468d05f1fe

Headers:

Content-Type: application/json; charset=utf-8

Body:

[
   {
      "ProductCode":"7290012491047",
      "ProductGroupCode":null,
      "Name":"Natural and Organic Calendula Shampoo 400ml",
      "Keywords":null,
      "ProductURL":null,
      "Description":"Natural and Organic Calendula Shampoo 400ml",
      "GenericHSCode":"",
      "Weight":"0.5000",
      "Height":null,
      "Length":null,
      "Width":null,
      "Volume":null,
      "ImageURL":"/c/a/calendula_shampoo.jpg",
      "ImageWidth":"",
      "ImageHeight":"",
      "OriginCountryCode":"",
      "ListPrice":"8.90",
      "OriginalListPrice":"47.2",
      "SalePrice":"8.90",
      "OriginalSalePrice":"47.2",
      "UnitSalePriceForDuties":null,
      "OriginalSalePriceAfterGlobalEDiscount":null,
      "VATRateType":{
         "VATRateTypeCode":"2",
         "Name":"VAT",
         "Rate":18
      },
      "Brand":null,
      "Categories":[
         {
            "CategoryCode":"4",
            "Name":"Baby"
         },
         {
            "CategoryCode":"18",
            "Name":"Calendula"
         },
         {
            "CategoryCode":"20",
            "Name":"Chamomile"
         },
         {
            "CategoryCode":"24",
            "Name":"​Coconut Oil"
         },
         {
            "CategoryCode":"26",
            "Name":"Geranium Oil"
         },
         {
            "CategoryCode":"29",
            "Name":"Jojoba"
         },
         {
            "CategoryCode":"30",
            "Name":"Lavender"
         },
         {
            "CategoryCode":"38",
            "Name":"Rosemary"
         },
         {
            "CategoryCode":"39",
            "Name":"Sea Buckthorn"
         },
         {
            "CategoryCode":"42",
            "Name":"Soapwort"
         },
         {
            "CategoryCode":"45",
            "Name":"Sunflower Oil"
         }
      ],
      "OrderedQuantity":1,
      "IsBlockedForGlobalE":null
   }
]

回答1:


The error you're receiving indicates that you're sending a GET request, not POST. Make sure that you have selected POST method in HTTP Sampler.

You may also find Testing SOAP/REST Web Services Using JMeter guide useful.



来源:https://stackoverflow.com/questions/21124444/jmeter-http-request-java-net-urisyntaxexception-illegal-character-in-query-at-i

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!