cURL 변환기 — cURL을 fetch, Python, Go, PHP로
cURL 명령을 fetch, Node, Python requests, Go, PHP, axios 코드로 변환. 메서드, 헤더, 쿠키, 본문도 분석해 줍니다.
cURL 명령
요청
POSThttps://api.example.com/v1/orders
쿼리 매개변수
2
- expand
- items
- limit
- 20
헤더
2
- Content-Type
- application/json
- Authorization
- Bearer demo_7f3a9c2e41
쿠키
2
- session
- 7d1f0c
- theme
- dark
본문
JSON
{
"customer": "cus_42",
"items": [
{
"sku": "KB-75",
"qty": 1
}
],
"note": "It's a gift"
}옵션
압축(--compressed)
// Browsers drop forbidden headers (Cookie, Host, Referer…).
// For cookies, use credentials: "include" instead.
// Browser manual redirects return an opaque response; the 3xx status and body are unavailable.
const response = await fetch("https://api.example.com/v1/orders?expand=items&limit=20", {
redirect: "manual",
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer demo_7f3a9c2e41",
"Cookie": "session=7d1f0c; theme=dark"
},
body: JSON.stringify({
"customer": "cus_42",
"items": [
{
"sku": "KB-75",
"qty": 1
}
],
"note": "It's a gift"
})
});
console.log(response.status, await response.text());POST · 25줄 · 경고: 0아무것도 전송되지 않음
브라우저에서 실행됩니다. 명령은 분석만 할 뿐 실행하지 않으며, 요청도 보내지 않습니다.
관련 도구
형식 참고 자료
도구 페이지 업데이트: