PHP JSON HTTP POST -
i have server accepts http post request json body , sends response in json. dont know way in php this.
i need send request server json body
{ myname="hitesh" myphone="8008288081" }
any highly appreciated.
the api available in server hosted @ xyz.hitesh.com , php code hosted @ abc.test.com
$requestbody = file_get_contents('php://input'); $requestbody = json_decode($requestbody); // ??? $response = array('accepted' => 'yes'); header('content-type: application/json'); echo json_encode($response);
Comments
Post a Comment