0

I want to submit some hundred HTTP requests using CURL, preferrably in parallel. This request simply shall submit a value to a server. How can I do this OS independent? I started writing a .txt file with a lot of lines looking like:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" url = http://localhost:8080/sales?salesAmount=111.91

Only the amount will vary.

Maybe better: The file contains only the amounts one in a line and the CURL command just reads each line as a parameter to be inserted into the CURL command!?

Moved to superuser.com

PoByBolek
  • 3,775
  • 3
  • 21
  • 22
du-it
  • 2,561
  • 8
  • 42
  • 80
  • sounds like a question for superuser.com , not stackoverflow.com - btw, a slight modification of [this script](https://stackoverflow.com/a/54353191/1067003) should be able to run hundreds, or even thousands of parallel requests very fast (thanks to the power of libcurl's curl_multi api) – hanshenrik Sep 05 '19 at 11:03
  • Hmmm,,,I don't know superuser.com. However, I don't want to code such complicated script. I am looking for a simple cURL command option to read a value from a file and put it into a placeholder in that command. (If cURL does provide something like that). – du-it Sep 05 '19 at 11:09
  • if you were asking on superuser.com rather than stackoverflow.com , i would point you towards curl's new (available since curl version 7.66)'s `--parallel` argument, but since you're asking on stackoverflow, i'm just voting to close this question as "belongs on superuser.com" instead. – hanshenrik Sep 05 '19 at 11:10
  • I posted this question now on superuser.com – du-it Sep 05 '19 at 11:13

0 Answers0