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

如何强制TRESTClient.BaseURL保留末尾的斜杠/?

强制保留TRESTClient.BaseURL末尾的斜杠

我需要访问的API请求URL是:https://myapi/api/v4/contract/id/recipients/

在代码里我这么设置:

var
  RESTClient : TRESTClient;
  ...

begin 
  RESTClient := TRESTClient.Create('');
  try
    RESTClient.BaseURL := 'https://myapi/api/v4/contract/id/recipients/';
    ShowMessage(RestClient.BaseURL);
    ...
  finally
    RESTClient.Free;
  end;
end;

但显示的RESTClient.BaseURL却是:

https://myapi/api/v4/contract/id/recipients

请问有没有办法强制保留末尾的/?我试过IncludeTrailingPathDelimiter方法,但它添加的是\;还找到了IncludeTrailingSlash方法,但编译器识别不了。


内容的提问来源于stack exchange,提问作者Damky

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.18 10:10:23