部分文字乱码问题该如何去解决

来源:7-3 带参数的get方法实现

cloudonthesun

2021-06-04

http://img.mukewang.com/szimg/60b9e92a0987df4109040363.jpg

http://img.mukewang.com/szimg/60b9e8eb0910534009660272.jpg

[
  {
    "description": "模拟一个不带参数的get请求",
    "request": {
      "uri": "/getdemo",
      "method": "get"
    },
    "response": {
      "text": "这是一二三123个没有参数的get请求"
    }
  },
  {
    "description": "模拟带参数的get请求",
    "request": {
      "uri": "/getwithparam",
      "method": "get",
      "queries": {
        "name": "huhansan",
        "age": "18"
      }
    },
    "response": {
      "text": "我胡汉三又回来啦!!!",
      "headers":{
        "Content-Type":"text/html;charset=utf-8"
      }
    }
  }
]


写回答

2回答

zzggsls

2021-11-07

建议这样写:response里增加gbk的设置就可以了

[

  {

    "description":"这是我们的第一个mock例子",

    "request":{

      "uri":"/demo"

    },

    "response":{

      "headers": {

        "Content-Type": "text/html;charset=gbk"

      },

      "text":"第一个moco框架demo"

    }


  }

]


1
0

大周

2021-06-07

改一下浏览器的字符编码就好了。  这个是浏览器的问题。 

0
0

Java接口自动化测试实战,搞定理论基础+典型应用场景

打破传统测试用例设计方法,搞懂基于TestNG的接口自动化测试技术

2087 学习 · 920 问题

查看课程