SHARE
TWEET

Untitled

a guest Mar 26th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $authorization = 'Basic '.base64_encode($this->client_id.':'.$this->client_secret);
  2.         $guzzle = new Client();
  3.         try {
  4.             $guzzle->post(
  5.                 $this->oauth_url,
  6.                 [
  7.                     'headers' => [
  8.                         'Content-Type' => 'application/x-www-form-urlencoded',
  9.                         'Authorization' => $authorization,
  10.                     ],
  11.                     'form_params' => [
  12.                         'grant_type' => 'authorization_code',
  13.                         'code' => $code,
  14.                         'redirect_uri' => $this->ruName,
  15.                     ],
  16.                 ]
  17.             )->getBody()->getContents();
  18.         } catch (BadResponseException $e) {
  19.             $response = $e->getResponse()->getBody();
  20.             $response->rewind();
  21.             dd(json_decode((string)$response->getContents()));
  22.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top