05-08-2019, 01:30 AM
test for yourself
Function Function21
Function Function21
long t1=perf
typelib MSXML2 {F5078F18-C551-11D3-89B9-0000F81FE221} 3.0
MSXML2.ServerXMLHTTP r._create
r.Open("POST" F"https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic")
r.setRequestHeader("content-type", "application/x-www-form-urlencoded")
r.SetRequestHeader("cache-control" , "no-cache")
str access= "access_token=24.b305c9822131e65eda05e29c157dd719.2592000.1559103982.282335-16139329&image="
str sFile.getfile("$desktop$\2.png");; change to file location
_s.encrypt(4 sFile "" 2)
_s.escape(9)
r.Send(F"{access}{_s}")
long t2=perf ;;get time after
out t2-t1 ;;display the difference
IXml x=JsonToXml(r.ResponseText)
ARRAY(IXmlNode) a
x.Path("root/words_result/item/words" a 1)
str d
for(int'i 0 a.len)
,d.addline(a[i].Value)
mes d.trim