D
D
Dvach2021-08-30 18:16:03
cmd/bat
Dvach, 2021-08-30 18:16:03

Sending text file content as curl parameter from cmd, how to do?

There is a file.txt with content, this content needs to be passed as a parameter to the curl post request, how to do it?

It should turn out something like this, but I can’t figure out how to read the contents of the file into a parameter, or how to equate the parameter to the cmd variable
curl --data-binary "param1=A¶m2=B&text=Here is the content of the txt file" https:// example.com

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wisgest, 2021-08-30
@wisgest

Get into a variable using SET /Pand redirecting the input stream, or using FOR /F.
Examples: forum.script-coding.com/viewtopic.php?id=5332

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question