简体   繁体   中英

How to escape pound symbol in the json post body for jmeter

I have the end point which has the post body as json but it gives exception as json parse exception while the text is having pound symbol ('£') in jmeter however it works fine in postman.

{"value":[{"text":"Paying £45 a month ok for you?"}]}

If I remove £ symbol then it works fine in jmeter.

I have already mentioned header as Content-Type: application/json in Jmeter.

Any thoughts please how to handle that pound symbol in the json body?

  1. Try amending Content-Type header to look like:

     application/json; charset=UTF-8 
  2. Make sure you run JMeter with the same encoding, add the next line to system.properties file:

     file.encoding=UTF-8 
  3. Set Content-Encoding to UTF-8 in the HTTP Request sampler or even better in HTTP Request Defaults so you wouldn't have to do this for all samplers individually.

    JMeter内容编码

  4. And finally given your request works in Postman you should be able to record it with JMeter's HTTP(S) test Script Recorder .

  5. Also consider upgrading to the latest JMeter version which is JMeter 4.0 as of now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM