alexfernandez/loadtest

POST issue

SantoshRaoBlr opened this issue · 2 comments

Hi,

The following request works fine from Postman and Curl

curl --location --request POST 'http://localhost:3000/updChannel'
--header 'transactionid: 25118f9c-6fc3-45bc-ab57-7eea5f8bee65'
--header 'Content-Type: application/json'
--data '{
"accountcode": "ABC111",
"channelurl": "https://xyz.slack.com/archives/GTAQV930A"
}'

I tried many equivalents in loadtest, but unable to get it to work

loadtest -n 1 -c 1 --rps 1 --debug
-m POST
-H "transactionid: 25118f9c-6fc3-45bc-ab57-7eea5f8bee65"
-H "Content-Type: application/json"
--data '{ "accountcode": "ABC111","channelurl": "https://xyz.slack.com/archives/GTAQV930A"}'
http://localhost:3000/updChannel


[Mon Feb 24 2020 12:10:07 GMT+0530 (India Standard Time)] INFO
[Mon Feb 24 2020 12:10:07 GMT+0530 (India Standard Time)] INFO 415: 1 errors

Request for some help please.

Can you try without a space between header and value? -H transactionid:25... -H Content-type:application/json. That is the only thing I can think of at the moment.

Thanks Alex, I could get it to work, after adding a -T option to set explicitly contentType to application/json