gpt4 book ai didi

delphi - Indy 在每个第 72 个字符处添加 = 并使用多部分表单数据发布

转载 作者:行者123 更新时间:2023-12-03 15:45:31 28 4
gpt4 key购买 nike

通过 Delphi XE 和 Indy,我得到了一些提交到 Web 表单的代码。

idhttp := TidHttp.create;
postData := TIdMultiPartFormDataStream.Create;
try
postData.AddFormField('name', edName.text);
postData.AddFormField('email', edEmail.txt);
postData.AddFormField('description', mDescription.text);

idhttp.Request.ContentType := 'Content-Type: multipart/form-data; boundary=' + postData.Boundary;
idhttp.fHttp.Post('http://www.example.com/contact.php', postData);

ShowMessage('Thank you for your contact us.');
finally
postData.Free;
idHttp.Free;
end;

但是,当我在描述备忘录中输入类似的内容时。

This is a really long descriptie piece of text so we can see just how it's wrapping these lines and what it's doig to them I think it's making a hash of it.

Argh waht a pain.

我明白了

This is a really long descriptie piece of text so we can see just how =
it's wrapping these lines and what it's doig to them I think it's maki=
ng a hash of it.

Argh waht a pain.

所以这对我来说似乎是自动换行,用=有人有任何线索吗?

最佳答案

您所看到的是正确的行为。 TIdFormDataField.ContentTransfer属性默认为quoted-printable对于文本字段。这正是您所看到的生成的编码类型。在 quoted-printable ,鞋底=字符后跟换行符称为“软”换行符。 MIME 就是这样分解长行文本以适应各种协议(protocol)(例如电子邮件)中的行长度限制的。

您可以更改 ContentTransfer属性为以下任何受支持的值:

  • 空白字符串
  • 7bit
  • 8bit
  • binary
  • quoted-printable
  • base64

如果您不希望对文本进行编码,请设置 ContentTransfer属性为 quoted-printable 以外的任何值或base64 .

关于delphi - Indy 在每个第 72 个字符处添加 = 并使用多部分表单数据发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7189794/

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