• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Send POST data via raw JSON with Postman

phpjsonrestpostman


PHP Snippet 1:

print_r(json_decode(file_get_contents("php://input"), true));

PHP Snippet 2:

foo=bar&foo2=bar2

PHP Snippet 3:

$.ajax({
    "url": "/rest/index.php",
    'data': JSON.stringify({foo:'bar'}),
    'type': 'POST',
    'contentType': 'application/json'
});

PHP Snippet 4:

$params = (array) json_decode(file_get_contents('php://input'), TRUE);
print_r($params);

Related Snippets

PHP -> Next nearest date defined by array of days in week

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

PHP Array split string and Integers

How to validate Envato Purchase Code in PHP

How to find phpcs current default standard

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

Composer fails with kylekatarnls/update-helper on new homestead

Select option menu read from database and use it's values

LARAVEL: How to fetch id dynamically in a query builder?

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

could not find driver Debian SQL Server PHP

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Could not decode a text frame as UTF-8.

Attempted to call an undefined method named "get" of class "MailController"

How to reset Laravel AuthManager/guards in between API calls in tests?

About Contact Privacy policy Terms and conditions