ローカル参照と公開済みの全モードを含む完全パッケージをインストールします。
install curlcurlリモートエンドポイントがサーバー側からどう見えるか確認したいときに
curl <url|host|me> [options]curl me現在のホストを使用する
curl example.comGET リクエストを送信して状態と本文を表示する
curl example.com -I最終レスポンスヘッダーだけを表示する
curl example.com -s [file]レスポンスを保存する; 省略時は URL のファイル名を使用する
curl example.com -X POST -d "a=1"リクエスト本文を送信する
-X <method>HTTP メソッドを設定する
-d <data>リクエスト本文を設定する; 既定は POST
-H "Name: value"リクエストヘッダーを追加する; 複数回指定可能
-u <user>非表示のパスワード入力で HTTP Basic 認証を使用する
-c '{"name":"value"}'JSON オブジェクトから cookie を送信する
-s [file] | -o <file>ホスト上にレスポンスを保存する
-a置換せず追記する; -s または -o が必要
-i最終レスポンスヘッダーを含める
-I最終レスポンスヘッダーだけを表示する
-jレスポンスを構造化 JSON で表示する
-edit @editレスポンス本文をテキストエディターで開く
-code @codeレスポンス本文をコードエディターで開く
-t [seconds]5 秒または 1 から 300 秒の任意のタイムアウトを使用する
-T300 秒のタイムアウトを使用する
-4 | -6-rリダイレクトを追跡しない
-k安全でない TLS 証明書を許可する
まず
-u <user> はパスワードを別入力で求めますが、-d の内容や cookie は履歴に残る場合があります。標準で TLS 証明書を検証し、最大 5 回リダイレクトします。-k は検証を無効に、-r はリダイレクトを無効にします。PHP -4/-6 は
PHP
用意された例をページ上でそのまま実行できます。結果は事前に生成されてブラウザに表示され、サーバーではターミナルコマンドを実行しません。
現在の互換バージョンをインストールします。全機能は Base、縮小版は Minimum を選び、すでに導入済みのモジュール更新には upgrade を使います。
Base と Minimum は同じ現在のモジュールリリースの二つのパッケージです。
ローカル参照と公開済みの全モードを含む完全パッケージをインストールします。
install curl縮小パッケージをインストールします。ローカルリファレンスは含まれず、
install curl -mこの公開済みバージョンを正確に指定してインストールします。
install curl -v 1.2.5upgrade が互換性を確認し、必要な場合だけブロックを置換します。
upgrade curlコアや他のモジュールに触れず拡張ブロックを削除します。
install curl -u例はコピーできますが、サイトは実行しません。実プロジェクトではパス、権限、破壊的オプションを確認してください。
curl https://example.comネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
<!doctype html>
<html>…</html>curl meネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
<!doctype html>
<html>…</html>curl https://example.com -Iネットワーク学習用例 — 実際の通信なし
HTTP/2 200
content-type: text/html; charset=UTF-8
cache-control: max-age=86000curl https://example.com -iネットワーク学習用例 — 実際の通信なし
HTTP/2 200
content-type: text/html; charset=UTF-8
<!doctype html>
<html>…</html>curl https://example.com -jネットワーク学習用例 — 実際の通信なし
{
"status": 200,
"url": "https://example.com/",
"headers": [
"HTTP/2 200",
"content-type: text/html; charset=UTF-8"
],
"body": "<html>…</html>"
}curl https://example.com -X POST -d "name=lil"ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Example response to a POST request; the server may reject POST or return another status.curl https://example.com -d "name=lil"ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Example response to a POST request; the server may reject POST or return another status.curl https://example.com -H "Accept: application/json"ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Request contains custom headers; the remote reply depends on the endpoint.curl https://example.com -H "Accept: application/json" -H "X-Demo: 1"ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Request contains custom headers; the remote reply depends on the endpoint.curl https://example.com -c '{"theme":"dark"}'ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Request includes Cookie: theme=dark; the server decides how to respond.curl https://example.com -u demoネットワーク学習用例 — 実際の通信なし
A separate secret-password prompt appears before the request is sent.curl https://example.com -sネットワーク学習用例 — 実際の通信なし
sandbox/
index.html
The response body is saved on the hosting account.curl https://example.com -s tmp/example.htmlネットワーク学習用例 — 実際の通信なし
sandbox/tmp/
example.html
The response body is saved on the hosting account.curl https://example.com -o tmp/example.htmlネットワーク学習用例 — 実際の通信なし
sandbox/tmp/
example.html
The response body is saved on the hosting account.curl https://example.com -o tmp/example.html -aネットワーク学習用例 — 実際の通信なし
sandbox/tmp/
example.html
The body is appended to the existing file.curl https://example.com -tネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Timeout option changes the maximum wait, not the response format.curl https://example.com -t 2ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Timeout option changes the maximum wait, not the response format.curl https://example.com -Tネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Timeout option changes the maximum wait, not the response format.curl https://example.com -4ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Requested IP family IPv4 (requires PHP cURL).curl https://example.com -6ネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Requested IP family IPv6 (requires PHP cURL).curl https://example.com -rネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Redirect following disabled; response status depends on endpoint.curl https://example.com -kネットワーク学習用例 — 実際の通信なし
HTTP: 200
URL: https://example.com/
Certificate verification disabled for this diagnostic request.curl https://example.com -editネットワーク学習用例 — 実際の通信なし
The installed text editor opens the response in a protected temporary file.curl https://example.com -codeネットワーク学習用例 — 実際の通信なし
The installed code editor opens the response in a protected temporary file.curl https://example.com -j -codeネットワーク学習用例 — 実際の通信なし
The installed code editor opens the response in a protected temporary file as formatted JSON.curl https://example.com -edit -s tmp/example.htmlネットワーク学習用例 — 実際の通信なし
Editor mode cannot be combined with -s or -ocurl https://example.com -aネットワーク学習用例 — 実際の通信なし
Append requires an output filecurl ftp://example.comネットワーク学習用例 — 実際の通信なし
Invalid URLcurl https://example.com -4 -6ネットワーク学習用例 — 実際の通信なし
Choose either IPv4 or IPv6curl https://example.com -X 9badネットワーク学習用例 — 実際の通信なし
Invalid HTTP methodcurl https://example.com -H "broken"ネットワーク学習用例 — 実際の通信なし
Invalid headercurl https://example.com -c not-jsonネットワーク学習用例 — 実際の通信なし
Invalid cookie JSONcurl https://example.com -t 301ネットワーク学習用例 — 実際の通信なし
Invalid timeoutcurl https://example.com -oネットワーク学習用例 — 実際の通信なし
Output file requiredcurl https://example.com -edit -codeネットワーク学習用例 — 実際の通信なし
Choose one editor