Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
httperf测试json rest api_Json_Rest_Httperf - Fatal编程技术网

httperf测试json rest api

httperf测试json rest api,json,rest,httperf,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=163

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

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的指针


提前感谢

您必须在标题末尾添加一个明确的carriege return,如下所示:


--add header='Content-Type:application/json\n'

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


httperf--print reply--print request--server“hostname.com”--uri=“url的其余部分”

带有头、post和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'