I am using the Requests for PHP library to POST some json data for another PHP script (I am using Laravel Response :: json to generate json output:
public function postIndex() { $input = Input::get(); $data = Response::json($input); $url = 'http://mydomain.com/emails/events'; $response = Requests::post($url, array('Content-Type' => 'application/json'), $data); return $response->status_code; }
I need a host-side script ( http://mydomain.com/emails/events ) to decode and process json, but I have a hard time accessing it. I am setting up a simple test script that sends me the contents of $ _POST, but every time it becomes empty.
$post_data = print_r($_POST,true); mail(" my@email.com ","post data",$post_data);
What am I doing wrong here?
Yev
source share