Locust:如何指定接受查询参数的获取请求

Raj*_*jat 4 python locust

我想对我的 get 请求进行负载测试

http://localhost:8080/v1/synonyms/project/?keyword=dealer
Run Code Online (Sandbox Code Playgroud)

和测试方法是

@task(2)
def get_synonym(self):
    response = self.client.get("/v1/synonyms/project/")
    print("Response status code:", response.status_code)
    print("Response content:", response.text)
Run Code Online (Sandbox Code Playgroud)

Cor*_*erg 8

在 url 中传递查询字符串:

response = self.client.get("/v1/synonyms/project/?keyword=dealer")