Curmudgeonly cURL

For reference, curmudgeonly. We all love a good curmedgeonly old fart, sometimes that’s exactly what cURL is, it has after all been around for a long time in tech years!

curl http://0.0.0.0:8080/hello/Adron

The straight usage of curl does a get against the URI and returns the response body of the request made.

curl -i http://0.0.0.0:8080/hello/Adron

or

curl --include http://0.0.0.0:8080/hello/Adron

The -i returns the header info of the response of the request made. It is the same as the –include option.

curl -H "connection: close" http://0.0.0.0:8080/hello/Adron

This curl command adds the connection: close option to the GET request to the curl command. The server then, instead of leaving the connection open afterwards immediately closes the connection and shows this in the response.

The commands above can be combined, as can others, into commands such as this.

curl -iH "connection: close" http://0.0.0.0:8080/hello/Adron

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s