レッスン 1

Reading cURL Commands 日本語ガイド

日本語の curl converter reading curl commands ガイド: Identify URL, method, headers, body flags, and shell quoting before conversion.

このコンテンツはまだ日本語で用意されていません。ローカライズが完了するまで English 版を表示しています。

A cURL command is both an HTTP request and a shell command. Before converting it, separate those two layers.

curl -X POST "https://api.example.com/users" \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ada"}'

The HTTP request contains:

  • Method: POST
  • URL: https://api.example.com/users
  • Headers: Authorization, Content-Type
  • Body: {"name":"Ada"}

The shell layer contains quotes, line continuations, and escaping rules.

URL placement

The URL may appear at the end, near the beginning, or after --url:

curl --url "https://api.example.com/search?q=json"

A converter should identify the request URL rather than assume it is always the last token.

Quoting matters

Single quotes, double quotes, and backslashes are interpreted by the shell before cURL receives arguments. A copied command from docs may be written for Bash, zsh, PowerShell, or CMD. Conversion should preserve the intended HTTP values, not the literal quote characters.

Body flags change defaults

When cURL sees -d, the request often becomes POST unless another method is specified. That default can surprise developers who expected GET.

Read the command in two passes: first as shell syntax, then as an HTTP request. Conversion becomes safer when those layers are not mixed together.

実践したいときは関連する DevCove ツールを使えます。任意であり、このレッスンの必須部分ではありません。

関連ツールを開く

コース概要へ戻る