使用 curl 我有:
$ curl -v -d "userName=user1&password=passwd1&language=en" http://myhost:23094/api/v2/authToken
...
> POST /api/v2/authToken HTTP/1.1
> User-Agent: curl/7.30.0
> Host: myhost:23094
> Accept: */*
> Content-Length: 39
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 39 out of 39 bytes
< HTTP/1.1 200 OK
我尝试使用此查询构建 yandex 坦克脚本:
我的加载.ini:
[phantom]
address=my.ip.v4.here
port=8094
rps_schedule=line(1, 10, 1m)
ammo_type=uripost
我的弹药.txt
133 login
POST /api/v2/authToken HTTP/1.1
User-Agent: tank
Host: somemyhost.com
Content-Length: 39
userName=user1&password=passwd1&language=en
当我运行时yandex-tank ammo.txt
,我收到 400 Bad Request 错误。在我看来,那个坦克不能使用身体参数。如何让它使用它们?我做错了什么?