M
M
martensit2016-08-23 10:13:34
cmd/bat
martensit, 2016-08-23 10:13:34

How, using BAT and the curl utility on windows, to save the received response from the request to a specific text file?

"C:\crl\curl.exe" " sms-activate.ru/stubs/handler_api.php?api_key=348g... "
Such a line in the batch file sends a Get request, and the response is displayed in the command line window, how to save this response to a specific file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-08-23
@martensit

-o, --output
Write output to instead of stdout. If you are using {} or [] to fetch multiple documents, you can use '#' followed by a number in the specifier. That variable will be replaced with the current string for the URL being fetched. Like in:
curl http://{one ,two}.example.com -o "file_#1.txt"
or use several variables like:
curl http://{site ,host}.host[1-5]. com -o "#1_#2"
You may use this option as many times as the number of URLs you have.
See also the --create-dirs option to create the local directories dynamically. Specifying the output as '-' (a single dash) will force the output to be done to stdout.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question