Skip to content

非公式 / UnofficialCloudflare, Inc. 非提携。アカウント情報は入力しないでください。Not affiliated with Cloudflare, Inc. Do not enter Cloudflare credentials here.Official docsこのサイトについてプライバシー

CURL

最終更新 Markdown で表示Agent セットアップ

The CURL component is used 73 times on 25 pages.

See all examples of pages that use CURL

Used 73 times.

Pages

Partials

CURL コンポーネントは、HTTP リクエスト用の cURL コマンドを表示します。

インポート

import { CURL } from "~/components";

使い方

import { CURL } from "~/components";

<CURL
	url="https://httpbin.org/anything"
	method="POST"
	json={{
		key: "va'l'ue",
	}}
	query={{
		foo: "bar",
		bar: ["baz", "qux"],
	}}
	code={{
		mark: "value",
	}}
/>

<CURL
	url="https://httpbin.org/anything"
	method="POST"
	form={{
		key: "value",
	}}
	code={{
		mark: "value",
	}}
/>

<CURL> の Props

url

required

type: string

リクエスト先の URL です。

method

type: "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "OPTIONS" | "PATCH"

default: "GET"

リクエストに使う HTTP メソッドです。

headers

type: Record<string, string>

リクエストに含めるヘッダーです。

json

type: Record<string, any> | Record<string, any>[]

リクエストに含める JSON データです。

form

type: Record<string, any>

送信する FormData ペイロードです。

query

type: Record<string, string | string[]>

リクエスト URL に付ける URL クエリパラメーターです。

code

type: object

Astro の Code props のオブジェクトです。利用できる props は Astro の Code コンポーネントのドキュメント ↗ を参照してください。

役に立ちましたか?