• <i id='S1Rx7'><tr id='S1Rx7'><dt id='S1Rx7'><q id='S1Rx7'><span id='S1Rx7'><b id='S1Rx7'><form id='S1Rx7'><ins id='S1Rx7'></ins><ul id='S1Rx7'></ul><sub id='S1Rx7'></sub></form><legend id='S1Rx7'></legend><bdo id='S1Rx7'><pre id='S1Rx7'><center id='S1Rx7'></center></pre></bdo></b><th id='S1Rx7'></th></span></q></dt></tr></i><div id='S1Rx7'><tfoot id='S1Rx7'></tfoot><dl id='S1Rx7'><fieldset id='S1Rx7'></fieldset></dl></div>
      <bdo id='S1Rx7'></bdo><ul id='S1Rx7'></ul>
  • <tfoot id='S1Rx7'></tfoot>

      <small id='S1Rx7'></small><noframes id='S1Rx7'>

      <legend id='S1Rx7'><style id='S1Rx7'><dir id='S1Rx7'><q id='S1Rx7'></q></dir></style></legend>

      1. file_get_contents("php://input") 或 $HTTP_RAW_POST_

        file_get_contents(quot;php://inputquot;) or $HTTP_RAW_POST_DATA, which one is better to get the body of JSON request?(file_get_contents(php://input) 或 $HTTP_RAW_POST_DATA,哪一个更适合获取 JSON 请求的正文?) - IT屋-程序员软件开发技术分享社
        <i id='CR3mO'><tr id='CR3mO'><dt id='CR3mO'><q id='CR3mO'><span id='CR3mO'><b id='CR3mO'><form id='CR3mO'><ins id='CR3mO'></ins><ul id='CR3mO'></ul><sub id='CR3mO'></sub></form><legend id='CR3mO'></legend><bdo id='CR3mO'><pre id='CR3mO'><center id='CR3mO'></center></pre></bdo></b><th id='CR3mO'></th></span></q></dt></tr></i><div id='CR3mO'><tfoot id='CR3mO'></tfoot><dl id='CR3mO'><fieldset id='CR3mO'></fieldset></dl></div>

          <legend id='CR3mO'><style id='CR3mO'><dir id='CR3mO'><q id='CR3mO'></q></dir></style></legend>
            <tbody id='CR3mO'></tbody>
        1. <tfoot id='CR3mO'></tfoot>
            • <small id='CR3mO'></small><noframes id='CR3mO'>

                <bdo id='CR3mO'></bdo><ul id='CR3mO'></ul>
                  本文介绍了file_get_contents("php://input") 或 $HTTP_RAW_POST_DATA,哪一个更适合获取 JSON 请求的正文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  file_get_contents("php://input")$HTTP_RAW_POST_DATA - 哪一个更适合获取 JSON 请求的正文?

                  file_get_contents("php://input") or $HTTP_RAW_POST_DATA - which one is better to get the body of JSON request?

                  当使用客户端 XmlHTTPRequest 时,我应该使用哪种请求类型(GETPOST)来发送 JSON 数据?

                  And which request type (GET or POST) should I use to send JSON data when using client side XmlHTTPRequest?

                  我的问题是从这个答案中得到启发的:如何使用 curl 将 JSON 发布到 PHP

                  My question was inspired from this answer: How to post JSON to PHP with curl

                  引用该答案:

                  从协议的角度来看,file_get_contents("php://input") 实际上更正确,因为您实际上并没有真正处理 http 多部分表单数据.

                  From a protocol perspective file_get_contents("php://input") is actually more correct, since you're not really processing http multipart form data anyway.

                  推荐答案

                  其实php://input可以让你读取原始请求体.

                  Actually php://input allows you to read raw request body.

                  它是 $HTTP_RAW_POST_DATA 的内存密集型替代方案,不需要任何特殊的 php.ini 指令.来自 参考

                  php://input 不适用于 enctype=multipart/form-data".

                  这篇关于file_get_contents("php://input") 或 $HTTP_RAW_POST_DATA,哪一个更适合获取 JSON 请求的正文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <tbody id='nvhir'></tbody>
                  <tfoot id='nvhir'></tfoot>

                    1. <i id='nvhir'><tr id='nvhir'><dt id='nvhir'><q id='nvhir'><span id='nvhir'><b id='nvhir'><form id='nvhir'><ins id='nvhir'></ins><ul id='nvhir'></ul><sub id='nvhir'></sub></form><legend id='nvhir'></legend><bdo id='nvhir'><pre id='nvhir'><center id='nvhir'></center></pre></bdo></b><th id='nvhir'></th></span></q></dt></tr></i><div id='nvhir'><tfoot id='nvhir'></tfoot><dl id='nvhir'><fieldset id='nvhir'></fieldset></dl></div>

                          <legend id='nvhir'><style id='nvhir'><dir id='nvhir'><q id='nvhir'></q></dir></style></legend>
                        • <small id='nvhir'></small><noframes id='nvhir'>

                          • <bdo id='nvhir'></bdo><ul id='nvhir'></ul>