문제

I have a file with this content:

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

and then I run this command:

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

But the server is not getting any json. I already tried different escape options without success.

And the same post with curl it works perfectly.

Do you have any pointer in posting json with httperf?

thanks in advance

도움이 되었습니까?

해결책

You have to add an explicit carriege return to the end of the header, like this:

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

다른 팁

Example with header, post and 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"

create file (httprefpost_data.txt) with below content:

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

Use the following to break the URL into server and URI:

httperf --print-reply --print-request --server "hostname.com" --uri="rest of url"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top