1. <small id='lu2IY'></small><noframes id='lu2IY'>

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

    1. <tfoot id='lu2IY'></tfoot>
      <legend id='lu2IY'><style id='lu2IY'><dir id='lu2IY'><q id='lu2IY'></q></dir></style></legend>
    2. 如何在 PHP 中获取请求内容(正文)?

      How to get request content (body) in PHP?(如何在 PHP 中获取请求内容(正文)?)
          <tbody id='vae7R'></tbody>
        <legend id='vae7R'><style id='vae7R'><dir id='vae7R'><q id='vae7R'></q></dir></style></legend>

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

          <bdo id='vae7R'></bdo><ul id='vae7R'></ul>

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

            1. <tfoot id='vae7R'></tfoot>

              • 本文介绍了如何在 PHP 中获取请求内容(正文)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在向内容中包含 XML 的 php 服务器发送请求:

                I am sending a request to a php server with a XML in the content:

                POST /index3.php HTTP/1.0
                Connection: Close
                Accept: application/xml
                Content-Type: text/xml
                
                <?xml version="1.0" encoding="UTF-8"?>
                <root />
                

                我已经检查了全局变量(例如 $_GET$_POST$_ENV$_FILES>, $_REQUEST...) 但它们都是空的.

                I've checked in globals vars (like $_GET, $_POST, $_ENV, $_FILES, $_REQUEST...) but they are all empty.

                如何检索服务器中的内容?

                How could I retrieve the content in the server?

                推荐答案

                试试这个

                $xml = file_get_contents('php://input');
                

                来自手册:

                php://input 是一个只读流,允许您从请求正文中读取原始数据.

                php://input is a read-only stream that allows you to read raw data from the request body.

                这篇关于如何在 PHP 中获取请求内容(正文)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                get a # from a url in php(从 php 中的 url 获取 #)
                PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)
                  <i id='M0tZf'><tr id='M0tZf'><dt id='M0tZf'><q id='M0tZf'><span id='M0tZf'><b id='M0tZf'><form id='M0tZf'><ins id='M0tZf'></ins><ul id='M0tZf'></ul><sub id='M0tZf'></sub></form><legend id='M0tZf'></legend><bdo id='M0tZf'><pre id='M0tZf'><center id='M0tZf'></center></pre></bdo></b><th id='M0tZf'></th></span></q></dt></tr></i><div id='M0tZf'><tfoot id='M0tZf'></tfoot><dl id='M0tZf'><fieldset id='M0tZf'></fieldset></dl></div>
                  <tfoot id='M0tZf'></tfoot>

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

                        <legend id='M0tZf'><style id='M0tZf'><dir id='M0tZf'><q id='M0tZf'></q></dir></style></legend>
                          <tbody id='M0tZf'></tbody>
                          <bdo id='M0tZf'></bdo><ul id='M0tZf'></ul>