• 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

How to insert data from multiple select dropdown values into database?

Warning: sqlite_query() expects parameter 1 to be resource, string given

Phalcon: setStatusCode returns empty response

Project structure for PHP

Sort a multidimensional array by integer inside of a string value which is two levels down

Check if string contains a value in array [duplicate]

How do I enable error reporting in Laravel?

How to Make Laravel Eloquent "IN" Query?

How to properly start Laravel 8 with Bootstrap & authentication

Reload parent page after submit in iframe

How can I get new CSRF token in LARAVEL by using ajax

MOODLE: What does it mean to aggregate h5p assets?

Elastic Beanstalk with Laravel Envoy

Error converting docx to pdf using Unoconv

Laravel Command Schedule Not Working Properly

About Contact Privacy policy Terms and conditions