-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
이대로 입력하면 window 환경에서는 에러가 발생.
ChatGpt의 솔류션
✅ 1️⃣ Windows CMD에서 실행할 경우
JSON 전체를 큰따옴표(") 로 감싸고
내부 큰따옴표는 이스케이프(") 처리해야 합니다.
curl -L -X POST "https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec" ^
-H "Content-Type: application/json" ^
-d "{\"name\":\"테스트\",\"email\":\"test@example.com\",\"phone\":\"010-0000-0000\",\"company\":\"테스트회사\",\"source\":\"검색엔진\",\"product\":\"제품A\"}"✔ 줄바꿈은 ^ 사용
✔ 한 줄로 써도 됨
한 줄 버전:
curl -L -X POST "https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec" -H "Content-Type: application/json" -d "{\"name\":\"테스트\",\"email\":\"test@example.com\",\"phone\":\"010-0000-0000\",\"company\":\"테스트회사\",\"source\":\"검색엔진\",\"product\":\"제품A\"}"✅ 2️⃣ Windows PowerShell에서 실행할 경우 (추천 👍)
PowerShell은 작은따옴표 사용 가능해서 훨씬 깔끔합니다.
curl -L -X POST "https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec" `
-H "Content-Type: application/json" `
-d '{
"name": "테스트",
"email": "test@example.com",
"phone": "010-0000-0000",
"company": "테스트회사",
"source": "검색엔진",
"product": "제품A"
}'✔ 줄바꿈은 백틱(`) 사용
✔ 작은따옴표 유지 가능
Gemini 솔루션
맥(Mac)이나 리눅스의 터미널(Bash/Zsh)은 작은따옴표(')를 문자열로 잘 인식하지만, 윈도우의 기본 명령 프롬프트(cmd)는 작은따옴표를 제대로 인식하지 못합니다. 윈도우 환경에서는 사용하시는 터미널(cmd vs PowerShell)에 따라 아래와 같이 문법을 살짝 바꿔주셔야 합니다.
1️⃣ 명령 프롬프트 (cmd) 기준
핵심: 바깥쪽은 큰따옴표(")로 감싸고, JSON 데이터 안쪽의 큰따옴표는 백슬래시()로 이스케이프(") 처리해야 합니다. 줄바꿈 기호도 \ 대신 ^를 씁니다.
curl -L -X POST ^
"https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec" ^
-H "Content-Type: application/json" ^
-d "{ \"name\": \"테스트\", \"email\": \"test@example.com\", \"phone\": \"010-0000-0000\", \"company\": \"테스트회사\", \"source\": \"검색엔진\", \"product\": \"제품A\" }"
2️⃣ PowerShell 기준
핵심: PowerShell에서는 curl이 Invoke-WebRequest라는 내장 명령어의 가짜 이름(Alias)으로 묶여 있는 경우가 많습니다. 그래서 명확하게 curl.exe라고 끝까지 쳐주시는 것이 안전하며, 줄바꿈 기호는 백틱(`)을 사용합니다.
curl.exe -L -X POST `
"https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec" `
-H "Content-Type: application/json" `
-d '{"name": "테스트", "email": "test@example.com", "phone": "010-0000-0000", "company": "테스트회사", "source": "검색엔진", "product": "제품A"}'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels