URL:='https://opi.tinysoft.com.cn/Service/Session/Call/';
sessionkey := "{xxx-xxx}"; //用户需替换成自己的session-key
header := "Connection: keep-alive\r\nContent-Type: application/json\r\nJSON-Encode: gbk\r\nTS-CALL-NAME: ops/__subscription__/time\r\nAuthorization: Bearer "+sessionkey;
ses := createhttpsession();
sethttpmode(ses, 1); //设置chunked模式(分段模式)
for i := 0 to 9999 do
begin
ret := InternetRequest(ses, URL, "", header, '{"anyname":"example"}', "", "", 0, res, resp, 500000);// {"anyname":"example"}用于传递参数,若无,可以设置为{}
echo "code:", resp, "->", res, "\r\n";
if ret then echo "time is:", datetimetostr(importjsonstring(res)["time"]), "\r\n";
end;
结果: