curl¶
download to current folder¶
-O keep remote filename
Sending a request with HEAD method (-I) to see the redirected url
Sometimes downloadd file has 0 size. Need to tell curl to follow HTTP redirection by using -L/--location
get with header¶
curl 'https://my.api/hello?id=1&name=dev' -H 'Accept: text/csv'
curl 'https://my.api/hello?id=1&name=dev' -H 'Accept: text/csv' -o my.csv
curl `https://my.api/hello -H "X-Custom-Header: value" -H "Content-Type: application/json"