How to insert certificate in request?

Asked

Viewed 16 times

0

To get the access token of a payment api I need to send two files, web.key and web.pem (CRT File = File .pem KEY File = File .Key). In Postman works perfectly by adding these certificates, now I don’t know how to proceed using the Http client of the Laravel. How to send?

My code until then without the certificate:

 $webKey = storage_path('/app/pagseguro_certificado/web.key');
    $webPem = storage_path('/app/pagseguro_certificado/web.pem');

    $credenciais = Http::withBasicAuth(env('CLIENT_ID'), env('CLIENT_SECRET'))->post(
        env('URL_PAGSEGURO_PIX') . '/pix/oauth2',
        [
            'grant_type' => 'client_credentials'
        ]
    );
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.