행위

"Autoit curl"의 두 판 사이의 차이

DB CAFE

(새 문서: 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 3...)
 
1번째 줄: 1번째 줄:
 
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/
  
 +
== 윈도우 파알 다운로드 ==
 
64bit
 
64bit
 
https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win64-mingw.zip
 
https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win64-mingw.zip
7번째 줄: 8번째 줄:
 
https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win32-mingw.zip
 
https://curl.haxx.se/windows/dl-7.69.1_1/curl-7.69.1_1-win32-mingw.zip
  
 +
== autoit 적용 소스 ==
 
<source lang=c>
 
<source lang=c>
 
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 $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)
21번째 줄: 23번째 줄:
 
ConsoleWrite($sOut&@LF&"*********"&@LF)
 
ConsoleWrite($sOut&@LF&"*********"&@LF)
 
</source>
 
</source>
 +
 +
== curl 사용법 ==
 +
 +
exam) https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html
 +
 +
본인이 테스트하려는 쿼리는
 +
-XGET 'localhost:9200/mctest_ilhee/_analyze' -d '{ "analyzer" : "ilhee_Custom", "text"" : "this is a test"}'.
 +
위의 값 대로 cURL 에 넣어보자!
 +
에러가 나온다.
 +
몇 번의  삽질.. 끝에 알아 낸 결과
 +
★★★★★
 +
' -> "로
 +
"-> "" 로
 +
변경을 해야한다.
 +
 +
ilhee_Custome 을 적용한 데이터가 잘 나오는 것을 확인할 수 있다.
 +
ilhee_Custome 은  ElasticSearch 글 내의 분석기 관련 글에서 확인할 수 있다.
 +
 +
cURL 은 ". ' 와 같은 부분을 잘 check 해서 쓰면 된다.
 +
cURL 사용법은" cURL --help " 로 원하는 매개변수를 잘 찾아쓰면 된다.

2020년 4월 8일 (수) 14:55 판

thumb_up 추천메뉴 바로가기


https://www.autoitscript.com/forum/topic/162599-can-someone-please-show-me-how-to-use-curl-and-autoit/

2 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)

3 curl 사용법[편집]

exam) https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html

본인이 테스트하려는 쿼리는 -XGET 'localhost:9200/mctest_ilhee/_analyze' -d '{ "analyzer" : "ilhee_Custom", "text"" : "this is a test"}'. 위의 값 대로 cURL 에 넣어보자! 에러가 나온다. 몇 번의 삽질.. 끝에 알아 낸 결과 ★★★★★ ' -> "로 "-> "" 로 변경을 해야한다.

ilhee_Custome 을 적용한 데이터가 잘 나오는 것을 확인할 수 있다. ilhee_Custome 은 ElasticSearch 글 내의 분석기 관련 글에서 확인할 수 있다.

cURL 은 ". ' 와 같은 부분을 잘 check 해서 쓰면 된다. cURL 사용법은" cURL --help " 로 원하는 매개변수를 잘 찾아쓰면 된다.