I am using a batch file to run a cURL command that uses a dynamically created json file as the payload. I am looping through each file in a directory, and setting the filename
variable, and using that for the resp
variable. However it seems that it's iterating for each file, but not resetting the filename
and resp
values. See Script Below
@echo on
for %%f in ("C:\po_responses\*.json") do (
set filename=@%%f
set resp=%%~nf_response.json
curl -g -H "Authorization:Bearer Token" -H "content-type:application/json" -H "accept:application/json" -X POST -d "%filename%" https://api.clientsite.com/ -o "%resp%"
)