Advanced curl Usage
· β 1 min read
1. RESTful Requests 1 curl -X POST --data 'keyword=value' http://domain.com/mypath/ After -X you can also use DELETE, PUT, and so on.
2. Adding Headers 1 curl -H 'Content-Type:application/json' -H 'Authorization: bearer MyToken' http://domain.com/mypath/ 3. Basic Authentication 1 curl -u username:password http://domain.com/mypath/ 4. Download and Execute 1 curl -sSL http://domain.com/my.sh | bash 5.