Category : guzzle

I’m working on Firebase Admin SDK with PHP kreait/firebase-php and It’s going well on the realtime database. However, the authentication wherein I want to create users give me fatal error where it says: Fatal error: Uncaught GuzzleHttpExceptionClientException: Client error: POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser resulted in a 400 Bad Request and I’m not experienced enough to know how ..

Read more

i’m trying to make auth2 authentication with bookingGo address like: https://auth.dispatchapi.taxi.booking.com/oauth2/token and retrieve a token. I have my client_id and secret_key for that, but when i’m making a request i have different errors. First of all i’ve tryed Laravel and GuzzleHttp like thst way: $response = $this->client->request("POST" , "/oauth2/token", [ ‘headers’ => [‘Content-Type’ => ‘application/x-www-form-urlencoded’], ..

Read more

I am trying to post to an external API, that accepts a XML file. The content type is application/octet-stream. This is my code: return Http::withToken(config(‘sproom.auth_token’)) ->withHeaders([ ‘Content-Type’ => ‘application/octet-stream’ ]) ->attach(‘xml’, file_get_contents(‘myfile.xml’), ‘myfile’) ->post(‘https://example.org/api/documents’)->json(); When posting the above, I get an API error back: Cannot find format for document. No further documentation exists. I am ..

Read more

I need to use an api in my website frontend, but I don’t want to expose that api’s key to my frontend users, so I’ve decided to make a proxy. However, I don’t think I’ve necessarily done it in the most clean, straight-forward, Laravel-like or Guzzle-like way. I’ll show my work: In web.php I added ..

Read more