View Single Post
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-02-2020 , 06:42   Re: REST in Pawn - Communicate with JSON REST APIs
Reply With Quote #72

Quote:
Originally Posted by splinterz View Post
hi, did u fix this?
i got same error like this..
i got null response.Data and i got empty json on my web server..
i tried to use api tester and its working fine so it should be my sourcemod plugin
You'll have to check the request body in PHP instead of the request parameters. Check this.

The request Content-Type is application/json instead of application/x-www-form-urlencoded.

PHP Code:
$body file_get_contents('php://input');
$data json_decode($body); 
__________________
Peace-Maker is offline