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.
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. Ignoring Certificate Validation
1
| curl -k https://domain.com/mypath/
|
6. Setting a Proxy
1
| curl -x socks5://proxyuser:proxypassword@proxy.domain.com:8001 https://domain.com/mypath/
|
7. Specifying a Host to Access by IP
1
| curl -H 'Host: www.domain.com' 1.2.3.4:8000
|