다른 명령
윈도우용 다운로드
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"