You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 00:12:13