工作中,需要入参,但是发现入参中,有中文的都是乱码,仔细查阅headers,发现Content-Type是application/x-www-form-urlencoded类型,而实际上,入参是json类型,因此需要强制修改请求头为json类型;

方法:

tools- rewrite- Enable Rewrite

 

charles请求入参中有乱码

 

1、勾选

2、name任意填写,location可以选择所有http开头的请求,根据需要进行填写,也可以填写需要的ip和端口,进行过滤

3、填写modify header

4、填写要修改的部分

5、填写要修改成的部分,点击保存

 

以上操作完成后,发出的请求header中,Content-type均为json类型

相关文章:

  • 2021-12-28
  • 2021-08-05
  • 2021-10-04
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
相关资源
相似解决方案