【发布时间】:2024-01-03 21:19:01
【问题描述】:
我通过 POST 从 C# 应用程序向 PHP 发送数据。对于内容类型,我使用 application/x-www-form-urlencoded。工作正常。
现在我想发送一个 base64 代码。我发现在 application/x-www-form-urlencoded 中它删除了像 + 这样的特殊符号。这将破坏 base64 代码。我已经阅读了有关 urlencoding 和 urldecoiding 的信息。但在我看来,这似乎不是一种可接受的方式。 urldecode 的 PHP 函数也不会正确地改回 sighn +。
是否有其他通过 POST 发送数据的好方法,也许是其他内容类型? application/json 或 application/xml 或 text/plain 怎么样? 它在 PHP 中是什么样子的?
最重要的是防止 urlencoding/urldecode。
【问题讨论】:
标签: c# php post base64 content-type