4

私はこの内容のファイルを持っています:

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を取得していません。私はすでにさまざまなエスケープオプションを試しましたが、成功しませんでした。

そして、カールのある同じ投稿は完璧に機能します。

httperfでjsonを投稿する際の指針はありますか?

前もって感謝します

4

3 に答える 3

6

次のように、ヘッダーの最後に明示的なキャリッジリターンを追加する必要があります。

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

于 2013-01-23T17:37:11.200 に答える
2

ヘッダー、投稿、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'
于 2018-03-16T06:10:11.037 に答える
1

以下を使用して、URLをサーバーとURIに分割します。

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

于 2015-12-14T20:44:25.860 に答える