httperf测试json rest api

时间:2012-11-27 16:39:24

标签: json rest httperf

我有一个包含此内容的文件:

helper?token=99999 method=POST contents='{"key1":99999, "key2":88888, "key3":55}'

然后我运行这个命令:

httperf --print-reply --print-request --hog --client=0/1 --server=a_server --port=8080 --uri=/ --rate=25 --send-buffer=4096 --recv-buffer=16384 --add-header='Content-Type:application/json' --method=POST --wsesslog=1,1.000,entrada_carga

但服务器没有得到任何json。我已经尝试了不同的逃生选项而没有成功。

与curl相同的帖子完美无缺。

使用httperf发布json时是否有指针?

提前致谢

2 个答案:

答案 0 :(得分:1)

使用以下命令将URL分解为服务器和URI:

httperf --print-reply --print-request --server“hostname.com”--uri =“其余的网址”

答案 1 :(得分:0)

标题,帖子和ssl

的示例
httperf --server yourhost.com.com --uri /smartlog --num-conns=500 --rate=500 --ssl  --method POST --wsesslog=100000,0,httprefpost_data.txt --add-header "sdk:3.0\nconfig:3.0\nzid:0\n"

使用以下内容创建文件(httprefpost_data.txt):

/smartlog method=POST contents='data=testing&uid=13'