How to call Gmail API using PHP and cURL?
问题 I have the oauth access token but my get request fails. Below is my code: $response = array(); $crl = curl_init(); $newurl = "https://www.googleapis.com/gmail/v1/users/myemail@gmail.com/messages?access_token=" . $result['access_token']; echo $newurl . "</br>"; curl_setopt($crl, CURLOPT_HTTPGET, true); curl_setopt($crl, CURLOPT_URL, $newurl); curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1); $reply = curl_exec($crl); if ( $reply ) { echo 'successfully retrieved messages</br>'; echo $reply; } else