Tool generating bash/powershell scripts from lists of curl commands. Also available as a web app at https://pkopel.github.io/curl-gen-web/.
- Run
stack installto build and installcurl-genexecutable. - Prepare a txt file with curl commands (like in examples)
- Run
curl-gen <path to .txt file>(writes results to stdout) orcurl-gen <path to .txt file> -o script.sh(example result) - To learn more about options run
curl-gen --help
-r|--random(optional) Include random values generator in the output script-t|--threads(optional) Make the output script multi-threaded (able to run multiple calls at the same time)-l|--language Bash|Powershell|OsDefault(optional, default:OsDefault) Select language of the output script.OsDefaulton Windows is Powershell, Bash otherwise.
# test example
curl -X PUT -k -v https://test.com/path \
--header 'Accept: application/json' \
--data '{"obj":{"string":"data"},"array":[1,null]}'Contents of the comment at the beginning are used to identify this curl call in script,
i.e. in this example, to make above call one would run script.sh test example