When i do a POST Request with Postman to the API of pushpad (https://pushpad.xyz/docs/rest_api) it works as expected and i get the push notification on desktop. However, when i do it manually it just shows some broken HTML Code which seems to be the Dashboard of Pushpad. I get no error at all, i get a status code 200 saying OK.
I have already tried the following:
$client = new Client([
'headers' => [ 'Content-Type' => 'application/json' ],
['Authorization' => 'Token token="for the sake of privacy removed in this question"'],
['Accept' => 'application/json'],
]);
$response = $client->post('https://pushpad.xyz/api/v1/projects/1234/notifications', [
'json' => [
['body' => 'testbody' , 'title' => 'testtitle']
]
]);
echo '<pre>' . var_export($response->getStatusCode(), true) . '</pre>';
echo '<pre>' . var_export($response->getBody()->getContents(), true) . '</pre>';
dd($response->getBody()->getContents());
I get a status code of 200 and for the content or body i just get a simple ' So the question is, why does it work in Postman but not manually. (Using Laravel 5.5, Guzzle) See the image for more details on what i did in postman and the result my manual code gave me. (Params are empty) Thanks a lot! image