gpt4 book ai didi

string - Delphi - Indy TIdHttp.Get 具有较大的 URL 长度

转载 作者:可可西里 更新时间:2023-11-01 16:24:28 24 4
gpt4 key购买 nike

我正在尝试使用 Indy 10 中的 GET 方法,但是,我的 URL 长度超过 255 个字符。并且 GET 方法只接受“字符串”参数。

body := httpCom.Get('..........wide string.........')

Delphi 的编译器给我错误:

"String literals may have at most 255 elements"

是否有任何解决方案或不同的第三方组件来解决这个问题?

最佳答案

那不是字符串类型的问题,而是IDE的问题,你可以这样写例如

Const
C_URL = 'A long text with 255 Characters ....to be contionued ...'
+'more content....to be contionued ... '
+'more more content....to be contionued ... '
+'enough content';
begin
IDHTTP1.Get(C_URL);
end;

  IDHTTP1.Get( 'A long text with 255 Characters ....to be contionued ...'
+'more content....to be contionued ... '
+'more more content....to be contionued ... '
+'enough content');

关于string - Delphi - Indy TIdHttp.Get 具有较大的 URL 长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17819521/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com