05-04-2019, 11:50 PM
there is no need, was for my trial and error only. you should look into chilkat it helps with json results
Function Function17
Function Function17
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest r._create
typelib Chilkat_v9_5_0 "$desktop$\ChilkatAx-9.5.0-win32.dll"
Chilkat_v9_5_0.ChilkatJsonObject js._create
Chilkat_v9_5_0.ChilkatJsonArray j._create
Chilkat_v9_5_0.ChilkatJsonObject jr._create
j=0;jr=0
r.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")
r.setRequestHeader("content-type", "application/x-www-form-urlencoded")
str sFile.getfile("$desktop$\1.png");; change to file location
_s.encrypt(4 sFile "" 2)
_s.replacerx("\+" "%2B")
r.Send(F"access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image={_s}&language_type=CHN_ENG&probability=true&detect_direction=true")
js.load(r.ResponseText)
;out js.Emit
j=js.ArrayOf("words_result")
;out js.StringOf("log_id")
;out js.StringOf("direction")
;out js.StringOf("words_result_num")
for int'i 0 j.Size
,jr=j.ObjectAt(i)
,str words_result=jr.StringOf("words")
,out words_result