## 基本操作
- **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) ### インスタンスのネットワーク設定 ``` ...
-
EVMの概念 EVMの概念 EVMの用語と計算式 略語 正式名称 訳語 計算式 BAC Budget At Completion 完了までの当初予算 - ...
-
## 使用するOSバージョンとAMIの選定 [AWS が Amazon EC2 での Microsoft Windows Server 2025 イメージの提供開始を発表](https://aws.amazon.com/jp/about-aws/whats-new/2024/1...
-
## 基本構文 ``` Test-NetConnection [-ComputerName] <string> [-Port <int>] [-InformationLevel <string>] [-TraceRoute] ``` ## ...
-
# CodeCommit ## HTTPS方式でアクセスする場合 予め、~/.aws/configファイルにプロファイルを作成し、リージョンや、アクセスキーを設定しておく。 ``` [profile git] region = us-east-1 output = json a...
0 件のコメント:
コメントを投稿