我用卷发:
$ 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坦克脚本:
我的load.ini:
[phantom]
address=my.ip.v4.here
port=8094
rps_schedule=line(1, 10, 1m)
ammo_type=uripost我的ammo.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个坏请求错误。在我看来,那个坦克不能用身体参数。如何让它使用它们?我做错什么了?
发布于 2015-02-19 18:21:14
你的弹药不是uripost格式的。根本不要指定ammo_type,它应该能正常工作。如果要使用uripost格式,请在load.ini中指定标题,并在弹药文件中编写如下内容:
39 /api/v2/authToken login
userName=user1&password=passwd1&language=en这是描述的uripost格式。
https://stackoverflow.com/questions/28613463
复制相似问题