다른 명령
새 문서: https://www.autoitscript.com/forum/topic/162599-can-someone-please-show-me-how-to-use-curl-and-autoit/ == 윈도우용 다운로드 == 64bit https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win64-mingw.zip 32bit https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win32-mingw.zip == autoit 적용 소스 == <source lang=c> Dim $iPidCurl = Run(@ComSpec & " /c " & 'curl -i -H' & 'Content-Type: application/x-www-form-urlencoded' & 'https://api.edmunds.com/inventory/token'... |
잔글 개발노트 양식 일괄 적용 |
||
| 1번째 줄: | 1번째 줄: | ||
{{개발노트 | |||
|요약=-d, --data: Send specified data in POST request. | |||
|핵심= | |||
|분야=Autoit | |||
|작성일=2024-10-04 | |||
}} | |||
https://www.autoitscript.com/forum/topic/162599-can-someone-please-show-me-how-to-use-curl-and-autoit/ | https://www.autoitscript.com/forum/topic/162599-can-someone-please-show-me-how-to-use-curl-and-autoit/ | ||
2026년 11월 12일 (목) 12:45 기준 최신판
DEVCAFE NOTE
Autoit-d, --data: Send specified data in POST request.
KEY POINTS · 핵심 정리
윈도우용 다운로드
64bit https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win64-mingw.zip
32bit https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win32-mingw.zip
autoit 적용 소스
Dim $iPidCurl = Run(@ComSpec & " /c " & 'curl -i -H' & 'Content-Type: application/x-www-form-urlencoded' & 'https://api.edmunds.com/inventory/token' & '-X POST -d ' & 'client_id=<MY SECRET ID >'&' -d ' & 'client_secret=<MY SECRET PHRASE>' & ' -d ' &'grant_type=client_credentials', @ScriptDir, @SW_HIDE,2+4)
Dim $sOut
While 1
$sOut &= StdoutRead($iPidCurl)
If @error Then ExitLoop
WEnd
While 1
$sOut &= StderrRead($iPidCurl)
If @error Then ExitLoop
WEnd
ConsoleWrite($sOut&@LF&"*********"&@LF)
curl 사용법
자주 사용하는 옵션 3가지
-d, --data: Send specified data in POST request. -H, --header: <header> Headers to supply with request. -X, --request: The request method to use. ex) GET, POST
[GET방식]
curl -d "key1=value1&key2=value2" \ -H "Content-Type: application/x-www-form-urlencoded" \ -X GET http://localhost:8000/data
[POST방식]
[URL형식 데이터]
curl -d "key1=value1&key2=value2" \
-H "Content-Type: application/x-www-form-urlencoded" \
-X POST http://localhost:8000/data
[JSON형식 데이터]
curl -d '{"key1":"value1", "key2":"value2"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:8000/data
- 원도우 curl에서는 '를 "로 변경하고, "를 ""로 변경하고 호출해야한다.
curl -d "{""key1"":""value1"", ""key2"":""value2""}" \
-H "Content-Type: application/json" \
-X POST http://localhost:8000/data
- ~ $bidtest = "https://buy.auction.co.kr/buy/bidlist.aspx?ItemNo=C045907557"