Payload retrieval methods and techniques
P粉176203781
2023-08-22 12:25:46
<p>I'm using PHP, ExtJS and ajax store. </p>
<p>It does not send data via POST or GET when creating, updating and deleting. In the Chrome console I can see my outgoing parameters as JSON in the "Request Payload" field. $_POST and $_GET are empty. </p>
<p>How to retrieve it in PHP? </p>
Meanwhile, you can use
writer
to configureencode
: true
to set up extJs so that it sends data periodically (so, You will be able to retrieve data via$_POST
and$_GET
).renew
At the same time, document also mentioned:
Therefore,
writer
'sroot
configuration may be required.If I understand the situation correctly, you are just passing the json data through the http body, not the
application/x-www-form-urlencoded
data.You can get this data using the following code snippet:
If you are passing json data, you can use the following code:
$data
now contains the json data in the php array.php://input
is a so-called wrapper.