`require('../config.php'); require('../HttpPost.class.php'); if(isset($_GET['code'])) {
$code = $_GET['code'];
$url = 'https://accounts.google.com/o/oauth2/token';
$params = array(
"code" => $code,
"client_id" => $oauth2_client_id,
"client_secret" => $oauth2_secret,
"redirect_uri" => $oauth2_redirect,
"grant_type" => "authorization_code"
);
$request = new HttpPost($url);
$request->setPostData($params);
$request->send();
$responseObj = json_decode($request->getHttpResponse(), true);
$access_token = $responseObj['access_token'];`
I followed the following code when trying to post content to the timeline of glass. https://github.com/backupbrain/google-mirror-insert-timeline-php
But i am getting an error on line 55 of outh2callback/index.php
saying that " Trying to get property of non-object"
which essentially means that there is no value in the $request->getHttpResponse()
Can anyone help me out on it as i am very new to glassware and i am trying to get hold of how things work!
Thank you !!