@martensit

Как, используя BAT и утилиту curl на windows, сохранить полученный ответ от запроса в определённый текстовый файл?

"C:\crl\curl.exe" "sms-activate.ru/stubs/handler_api.php?api_key=348g..."

Такая строка в батнике посылает Get запрос, а ответ высвечивается в окне командной строки, как этот ответ сохранить в определённый файл?
  • Вопрос задан
  • 3012 просмотров
Решения вопроса 1
-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.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы