curl
README - Everything curl
download file by curl
code:shell
curl -O https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2
複数ファイル指定する場合は、複数の -O を使えばok
download and unarchive tar.gz
code:shell
curl -L <URL> | tar -zxvf -
-L はリダイレクトされていても取得するため
ダウンロード先を指定するには -C /path を付け加える
最近の curl は json オプションがあるという、、、
https://everything.curl.dev/http/post/json
生の json 渡すには
https://swfz.hatenablog.com/entry/2019/07/07/035341
code:shell
curl -XPOST http://127.0.0.1:3000 \
-d @- <<EOS
{
"query": {
"hoge": 1,
"fuga": "fuga",
"piyo": ${piyo_number}
}
}
EOS
Bearer
code:shell
curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <token>' \
localhost:8080/api/v1/login
MacOS
Pre-installed curl uses LibreSSL
If you want to use latest curl, install via homebrew
macOS - Everything curl
TLS
curl - SSL CA Certificates
名前解決
curl --resolve