Languages
[Edit]
EN

PHP - receive json POST request

9 points
Created by:
Aran-Busby
592

In this article, we would like to show you how to receive json requests in PHP.

Parse JSON input stream example

Edit

backend.php file:

Note: to use different request method read this article.

ajax.htm file:

Result:

jQuery POST JSON request to PHP server
jQuery POST JSON request to PHP server

References

Edit
  1. php://input stream - PHP Docs
  2. file_get_contents function - PHP Docs
  3. json_decode function - PHP Docs

Alternative titles

  1. PHP - send json in POST request
  2. PHP - send json as POST request
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join