Skip to content

Tag: reactjs

Why doesn’t the message POST

When sending data, an empty value comes in Yii2, why is that? Data post: id, name. JS PHP } Code 200, post null Answer By default the Yii reads post params from $_POST global variable. But web server only parses request of body send as application/x-www-form-urlencoded or multipart/form-data. If you send data…

General questions about php and react.js [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago. Improve this question I’m about to learn react.js but I have a lot of questions, if I&#8…

React can’t get response body from PHP API

I’m trying to send a POST request to my PHP file and get a response. The response is sent with code 200, however, I don’t see what PHP returns. Here is my react code: And here is my PHP code: Logging response on console returns me: I can’t get the “data” out of PHP. Answer