Answer the question
In order to leave comments, you need to log in
How to extract link from curl response in bat file?
I make a request via curl from a bat file. From the request response body
{
"href":"https://uploader9m.disk.yandex.net:443/upload-target/20160623T092605.135.utd.eb5dbfed7bwwb6imitb6xku41-k9m.5744252",
"method":"PUT",
"templated":false
}
"https://uploader9m.disk.yandex.net:443/upload-target/20160623T092605.135.utd.eb5dbfed7bwwb6imitb6xku41-k9m.5744252"
Answer the question
In order to leave comments, you need to log in
I used the jq
console utility , as a result, getting href from the response for my case looks like this:
for /f "delims=" %%i in ('curl -H %H% %link_to_get_upload%') do set response=%%i
echo %response% | C:\jq.exe ".href" > %file%
set /p upload_url= < %file%
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question