原因为data数据不是json类型,需要使用json.dumps(data)进行格式化,代码如下:

class UserBehavior(TaskSet):
  
    @task(1)
    def interface_1(self):
        headers = {"Content-Type": "application/json"}
        url = "/robat/cock/cock"
        data = { 
	    "taskid": "20180703101505551",
	    "uinid": "29007037"
        }
        aaa = json.dumps(data)
        self.client.post(url=url, data=aaa, headers=headers)

  

 

相关文章:

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