3

In this command:

curl -d param1=value1 -d param2=value2 http://example.com/submit

If value1 is located in file1.txt, how can I make cURL include file1.txt in the command?

1 Answer 1

5

Something like this should do the trick: curl -d param="$(cat file1.txt)" ...

3
  • 2
    You can also do $(< file1.txt) and avoid using cat.
    – Reid
    Jul 25, 2011 at 16:02
  • Right. I just love cats :)
    – alex
    Jul 25, 2011 at 18:02
  • 2
    You can do '--data-urlencode' option with '[email protected]' semantic :). Sep 19, 2011 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .