|
@@ -0,0 +1,31 @@
|
|
|
|
+# Curl useful commands
|
|
|
|
+
|
|
|
|
+Simplest way to `GET` data
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+$ curl example.com
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+Show response header
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+$ curl -i https://example.com
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+`GET` json and show it nicely
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+$ curl https://example.com/json | jq
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+`HEAD` only shows the response headers
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+$ curl -I https://example.com
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+Please follow redirects
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+$ curl -I -L https://example.com/redirected
|
|
|
|
+```
|