Is there a way to use curl to send a POST request without sending any data?
We usually post like:
curl --data @C:\mydata.txt http://1.2.3.4/myapi
If you omit the --data
you are doing a GET. How can you omit it and still do a POST?
Is there a way to use curl to send a POST request without sending any data?
We usually post like:
curl --data @C:\mydata.txt http://1.2.3.4/myapi
If you omit the --data
you are doing a GET. How can you omit it and still do a POST?
This is a bit of a hack, but you could always provide an empty --data file.
Alternately
cat /dev/null | curl --data @- http://...
Randomly found the solution on another post:
curl -X POST http://example.com