I want to test a few POST APIs using vegeta, but the post payload is not getting send properly.
vegeta command:
vegeta attack -targets=tmp -rate=1 -duration=1s | tee results.bin | vegeta report
tmp file:
POST http://server-ip/api/salon
@saloninfo.json
saloninfo.json file:
{
"salon_id" : "562737c1ff567dbd5574c814"
}
Basically, the payload is going empty {}.
Can someone please check, what i might be missing.
I believe this is because you need to set the
content type: application/json.Unfortunately the documentation and github issues mention it obliquely but with no indication as to exactly where it's supposed to be, either as a header for the json or in the vegeta command like Curl. Still looking for the answer here.