2017-05-03 63 views
2

我正在使用loadtest來加載我的節點應用程序。我有問題通過loadtest發送發佈請求。請求的形式是:請求正文在loadtest中不正確

loadtest http://localhost:7000/eth/checkEthBalance -T "application/x-www-form-urlencoded" -H "application/x-www-form-urlencoded" -m "POST" --data '{"accountAddress":"0x62720366ef403c9891e2bfbd5358ee3c8a57b113"}' -n 1 

但在req.body,我得到:的

{ '{"accountAddress":"0x62720366ef403c9891e2bfbd5358ee3c8a57b113"}': '' } 

代替:

{"accountAddress":"0x62720366ef403c9891e2bfbd5358ee3c8a57b113"} 

然而捲曲請求workd FAB:

curl -X POST \ 
    http://localhost:7000/eth/checkEthBalance \ 
    -H 'cache-control: no-cache' \ 
    -H 'content-type: application/x-www-form-urlencoded' \ 
    -H 'postman-token: 0bf637f7-2037-c4ca-29a7-cc2310786317' \ 
    -d accountAddress=0x62720366ef403c9891e2bfbd5358ee3c8a57b113 

不知道什麼是wr用loadtest進行測試。任何幫助?

回答

0

在這裏,我是怎麼做的,你需要傳遞-T 'application/json'

樣品:loadtest -P '{"name" : "ashok dey", "email" : "[email protected]", "password" : "password123"}' -c 100 --rps 2000 http://localhost:3434/register -T 'application/json'

你當你傳遞一個包含交的數據文件,以使其通過。