tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.06k stars 1.34k forks source link

Vegeta attack should accept targets in cURL format #621

Open krishna15898 opened 1 year ago

krishna15898 commented 1 year ago

Proposal

Sending load via vegeta using the HTTP request in cURL format rather than writing it in the json or http formats as defined in the usage manual. This could be using the -targets flag pointing to a file which contains the request in the cURL format (and curl as an addition to the possible options for the -format flag).

An example of contents of a target file containing the request in the curl format -

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/resource
curl --data "param1=value1&param2=value2" POST http://hostname/resource

The target files containing requests in cURL format can also have rules about having comments after a # or post requests being able to refer to @/path/to/body.json for their request bodies like vegeta currently does for files in the http format.

Background

More often than not, we have HTTP requests in cURL format, but when sending those requests via vegeta, we have to change the format to the ones specified by Vegeta (either json or http). If vegeta accepted requests in cURL format and converted them to vegeta format internally, that would be very helpful.

Workarounds

None that I am aware of.