Reputation: 327
I'm trying to send some data from postman to server but PHP always return null, PHP only gets the data when I send it using raw body.
PHP Code:
<?php
require_once("_config.php");
if($_SERVER['PHP_AUTH_USER'] == AUTH_USER && $_SERVER['PHP_AUTH_PW'] == AUTH_PW){
$data = file_get_contents("php://input");
echo $data;
}
?>
Upvotes: 2
Views: 3613
Reputation: 327
Okay guys, I solved it by removing one of postman headers. I removed Content-Type.
Upvotes: 4