delphi – Indy在每72个字符处添加=多部分表单数据Post

delphi – Indy在每72个字符处添加=多部分表单数据Post,第1张

概述使用Delphi XE和Indy,我得到了一些提交到Web表单的代码. idhttp := TidHttp.create;postData := TIdMultiPartFormDataStream.Create;try postData.AddFormField('name', edName.text); postData.AddFormField('email', edEm 使用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中,sole =字符后跟换行符称为“软”断点.这就是MIME如何分解长行文本以适应各种协议(如电子邮件)中的行长度限制.

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

>一个空白字符串
> 7bit
> 8位
>二进制
>引用可打印
> base64

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

总结

以上是内存溢出为你收集整理的delphi – Indy在每72个字符处添加=多部分表单数据Post全部内容,希望文章能够帮你解决delphi – Indy在每72个字符处添加=多部分表单数据Post所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1216188.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存