Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $authorization = 'Basic '.base64_encode($this->client_id.':'.$this->client_secret);
- $guzzle = new Client();
- try {
- $guzzle->post(
- $this->oauth_url,
- [
- 'headers' => [
- 'Content-Type' => 'application/x-www-form-urlencoded',
- 'Authorization' => $authorization,
- ],
- 'form_params' => [
- 'grant_type' => 'authorization_code',
- 'code' => $code,
- 'redirect_uri' => $this->ruName,
- ],
- ]
- )->getBody()->getContents();
- } catch (BadResponseException $e) {
- $response = $e->getResponse()->getBody();
- $response->rewind();
- dd(json_decode((string)$response->getContents()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement