Does anybody know the correct way to post
JSON using Guzzle
?
$request = $this->client->post(self::URL_REGISTER,array(
'content-type' => 'application/json'
),array(json_encode($_POST)));
I get an internal server error
response from the server. It works using Chrome Postman
.
For Guzzle <= 4:
It's a raw post request so putting the JSON in the body solved the problem