Troubleshooting Web Connections

curl and 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 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 ''

!!! -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 ''


To post json directly:

curl -X POST -H "Content-Type: application/json"
-d '{"username":"abc","password":"abc"}'


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.

See Also

wget is better suited for web scraping applications.