Show pageBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== curl ====== ===== Basic Usage ===== <code> curl https://www.google.com </code> ===== Use It Without Proxy ===== <code> curl --noproxy "*" https://www.google.com </code> ===== Verbose ===== Add -v or --verbose to the command. It will list out more information for your HTTP connection <code>-v, --verbose Make the operation more talkative</code> ===== POST ===== Connect to a local server with username and password. (Should use HTTPS for production site) <code> curl --noproxy "*" -v http://127.0.0.1:8080/authenticate -d "username=username&password=password" </code> ===== POST with JSON===== Connect to a local server with username and password. (Should use HTTPS for production site). Note that for WINDOWS platform, single quote is not supported. <code> For Windows: curl --noproxy "*" -v -H "Content-Type: application/json" http://127.0.0.1:8080/authenticate -d "{\"username\":\"username\", \"password\": \"password\"}" For Other platform: curl --noproxy "*" -v -H "Content-Type: application/json" http://127.0.0.1:8080/authenticate -d '{"username": "username", "password": "password"}' </code> ===== Adding Something in the HTTP header ===== This could be user for JWT, header authentication. <code> curl http://127.0.0.1:8080/ -H "Something: anything" </code> ===== Connect to Self-signed SSL Site ===== add -k, or --insecure to the command. <code>-k, --insecure Allow insecure server connections when using SSL</code> ===== Follow the URL ===== curl will not automatically redirect to a site like the browser does. In order to do it, add -L, or --location in the command <code>-L, --location Follow redirects</code> else/curl.txt Last modified: 2020/08/07 16:33by chongtin