Rishabh Mishra
Rishabh Mishra

Reputation: 508

How to send json from apache benchmark without external file?

I have JSON from postman collection and i am iterating the requests list and calling ab from my script. get is working fine. I have json of request body, how i can send json with ab without using external file.

Upvotes: 2

Views: 316

Answers (1)

Lebecca
Lebecca

Reputation: 2878

Yes, ab can read from stdin and we can use that to send JSON without using an external file.

echo '{"foo": "bar"}' | ab -p /dev/stdin -k -c 1 -n 10000 "http://localhost:8080" > ret.txt

Upvotes: 0

Related Questions