📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)
| 56行目: | 56行目: | ||
== curlコマンドのオプション == | == curlコマンドのオプション == | ||
<center> | |||
{| class="wikitable" | style="background-color:#fefefe;" | |||
|- | |||
! style="background-color:#66CCFF;" | オプション | |||
! style="background-color:#66CCFF;" | 説明 | |||
! style="background-color:#66CCFF;" | 実行例 | |||
|- | |||
| -A<br>--user-agent || UAを指定する。 || curl -A "Mozilla/5.0" https://example.com | |||
|- | |||
| -b<br>--cookie || クッキーを指定する。 || curl -b "name=value" https://example.com | |||
|- | |||
| -c<br>--cookie-jar || 取得したクッキーをファイルに保存する。 || curl -c cookies.txt https://example.com | |||
|- | |||
| -d<br>--data || POSTリクエストで送信するデータを指定する。 || curl -d "data=value" https://example.com | |||
|- | |||
| -D<br>--dump-header || レスポンスヘッダをファイルに保存する。 || curl -D headers.txt https://example.com | |||
|- | |||
| -F<br>--form || フォームデータを送信する。 || curl -F "file=@file.txt" https://example.com | |||
|- | |||
| -H<br>--header || カスタムヘッダを追加する。 || curl -H "Content-Type: application/json" https://example.com | |||
|- | |||
| -I<br>--head || ヘッダ情報のみを表示する。 || curl -I https://example.com | |||
|- | |||
| -k<br>--insecure || SSL / TLS認証を無視する。 || curl -k https://example.com | |||
|- | |||
| -L<br>--location || リダイレクト先に追従する。 || curl -L https://example.com | |||
|- | |||
| -o<br>--output || 取得したデータをファイルに保存する。 || curl -o output.html https://example.com | |||
|- | |||
| -O<br>--remote-name || URLのファイル名でファイルを保存する。 || curl -O https://example.com/file.zip | |||
|- | |||
| -s<br>--silent || サイレントモードを有効にする。 || curl -s https://example.com | |||
|- | |||
| -u<br>--user || ユーザ名とパスワードを指定して認証を行う。 || curl -u username:password https://example.com | |||
|- | |||
| -x<br>--proxy || プロキシサーバを指定する。 || curl -x http://proxy.example.com:8080 https://example.com | |||
|- | |||
| -X<br>--request || HTTPメソッド(GET, POST, PUT, DELETE) || | |||
POSTリクエスト送信<br>curl -X POST -d “data=value” https://example.com<br><br> | |||
PUTリクエストの送信<br>curl -X PUT -d “data=new_value” https://example.com/resource/1<br><br> | |||
DELETEリクエストの送信<br>curl -X DELETE https://example.com/resource/1<br> | |||
|} | |||
</center> | |||
<br><br> | <br><br> | ||