Delphi调用RESTful API时出现Could not load SSL Library问题求助
调用HTTPS短信API时遇到"Could not load SSL Library"错误
我尝试通过站点提供的API连接短信服务器,使用该站点的ApiKey编写了如下代码,运行时出现错误:
Could not load SSL Library
代码如下:
procedure TMainF.Button1Click(Sender: TObject); var params:TStringList; JsonObj:TJSONObject; ResStr:String; idHttp:TIdHTTP; begin params:=TStringList.Create; IdHTTP:=TIdHTTP.Create; IdHTTP.Request.BasicAuthentication:=False; IdHTTP.Request.ContentType:='application/json'; IdHTTP.Request.CharSet:='utf-8'; IdHTTP.Request.Accept:='application-json'; IdHTTP.Request.CustomHeaders.Values['Authorization']:='BASIC APIKEY:'+EditApi.Text; try resStr:=IdHTTP.Post('https://sms.XSite.ir/Apiv2/User/Credit',params); finally idHttp.Free; end; JsonObj:=TJSONObject.ParseJSONValue(ResStr) as TJSONObject; Memo1.Text:=ResStr; if JsonObj <> nil then try Memo1.Lines.Add(JsonObj.Values['Amount'].Value); finally JsonObj.Free; end; end;
这段代码原本用于获取并显示账户剩余余额。
内容的提问来源于stack exchange,提问作者saeed bay
相关产品推荐
相关产品推荐

