## 基本操作
- **GETリクエスト**
```bash
curl https://example.com
```
- レスポンスをファイル保存
```
curl https://example.com -o output.txt
```
- 詳細表示(デバッグ用)
```
curl -v https://example.com
```
---
## ヘッダー関連
- レスポンスヘッダーのみ表示
```
curl -I https://example.com
```
- リクエストヘッダー追加
```
curl -H "Authorization: Bearer TOKEN" https://example.com
```
---
## 認証
- BASIC認証
```
curl -u user:password https://example.com
```
- Cookie認証
```
curl -c cookie.txt -d "id=user&pw=pass" https://example.com/login
curl -b cookie.txt https://example.com/data
```
---
## HTTPメソッド指定
- POSTリクエスト
```
curl -X POST -d "key=value" https://example.com
```
- JSONデータ送信
```
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://example.com/api
```
- PUTリクエスト
```
curl -X PUT -d @file.json https://example.com/api
```
---
## ファイル操作
- ダウンロード(元のファイル名を保持)
```
curl -O https://example.com/file.zip
```
- 複数ファイルダウンロード
```
curl -O URL1 -O URL2
```
---
## その他便利オプション
- リダイレクトを追跡
```
curl -L https://short.url
```
- 通信内容をダンプ
```
curl --trace-ascii - https://example.com
```
- 処理時間を表示
```
curl -w "%{time_total}\n" https://example.com
```
- SSL検証を無視(テスト用途のみ推奨)
```
curl -k https://example.com
```
2025/12/09
curlコマンドチートシート
登録:
コメントの投稿 (Atom)
人気の投稿
-
## 作業前確認 [Amazon Linux 2023 リリースノート](https://docs.aws.amazon.com/ja_jp/linux/al2023/release-notes/relnotes.html) ### インスタンスのネットワーク設定 ``` ...
-
# サインイン画面 [TrendAI Vision One™ サインイン](https://signin.v1.trendmicro.com/) # サブスクリプションの種類 - 従量課金(PAYG) [TrendAI Vision One™ (PAYG)](https://...
-
PCのローカルでソース管理するだけなら、ローカルリポジトリだけ作ればOK。 ## Git環境構築手順 ### 1. Gitをインストール ### 2. Gitの初期設定 * 必要な設定を行う。 ``` git config --global user.name ...
-
## 基本構文 ``` Test-NetConnection [-ComputerName] <string> [-Port <int>] [-InformationLevel <string>] [-TraceRoute] ``` ## ...
-
# インストール [https://www.vim.org/download.php](https://www.vim.org/download.php) # カスタマイズ 1. Vimの設定ファイル(_vimrc)を作成 **ファイルパス**: C:\Users\(ユーザ...
0 件のコメント:
コメントを投稿