Reputation: 311
I'm trying to post a list of identifiers as a form value from a file using curl. I've tried many different formats but each time the filename is posted rather than the actual data.
An example I have tried is below:
curl http:localhost:<port>/test --data "userId=User" --data "uploadIds=<test.txt"
curl http:localhost:<port>/test --data "userId=User" --data "[email protected]"
each of the above results in the filename being posted.
The file contains a comma-separated list of numbers.
Upvotes: 0
Views: 527
Reputation: 311
Found the solution, the syntax I was looking for is:
curl http:localhost:<port>/test --data "userId=User" --data-urlencode [email protected]
Upvotes: 1