Troubleshooting Web Connections
wget are both useful tools.
1.3 What is cURL not? Curl is not a wget clone even though that is a very common misconception. Never, during curl's development, have we intended curl to replace wget or compete on its market. Curl is targeted at single-shot file transfers. _ Curl is not a web site mirroring program. If you wanna use curl to mirror something: fine, go ahead and write a script that wraps around curl to make it reality (like curlmirror.pl does).
curl -X GET [options] [URL] curl -X POST [options] [URL]
The -X option specifies which HTTP request method will be used when communicating with the remote server.
One way to pass parameters to a POST request is to use the -d option. This causes curl to send the data using the application/x-www-form-urlencoded Content-Type.
curl -X POST -d 'name=linuxize' -d 'firstname.lastname@example.org' https://example.com/contact.php
!!! -d seems to be what node/express servers are expecting when processing POST requests
The alternative is -F. When the -F option is used, curl sends the data using the multipart/form-data Content-Type.
curl -X POST -F 'name=linuxize' -F 'email@example.com' https://example.com/contact.php
To post json directly:
curl -X POST -H "Content-Type: application/json"
TLS / SSL
With self signed certificates, it may be necessary to tell curl to connect even if it is not a validated certificate.
With the curl command line tool, you disable this with -k/--insecure.
wget is better suited for web scraping applications.