## 基本操作
- **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) ### インスタンスのネットワーク設定 ``` ...
-
## 基本構文 ``` Test-NetConnection [-ComputerName] <string> [-Port <int>] [-InformationLevel <string>] [-TraceRoute] ``` ## ...
-
Gitでは変更の保存先が4つの場所に分かれており、コマンドによってどの場所まで変更を反映するかが決まる。 `add` → `commit` → `push` と段階を踏むのが基本で、`commit -a` や `pull` は複数の操作をひとつのコマンドにまとめた省略形にあ...
-
[AWS CloudFormation とは何ですか?](https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/Welcome.html) ## CloudFormationの動作概要 ポイン...
-
SCTとDMSを使用してオンプレミスにあるOracleをAWSのRDSへ移行してみる。 - [AWS Schema Conversion Toolとは](https://docs.aws.amazon.com/ja_jp/SchemaConversionTool/latest/...
0 件のコメント:
コメントを投稿