I am using the following link for using the Google Cloud Storage :
I want to upload an object using insert function given in the above API.I am using PHP. The code i am using is as follows :
$StorageService = new Google_StorageService($client);
$objects = $StorageService->objects;
$gso = new Google_StorageObject();
$gso->setName('myobj');
$postbody = array(file_get_contents('buc.jpg'));
$resp = $objects->insert('mybucket', $gso, $postbody);
But i m getting Error as :
Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling POST https://www.googleapis.com/storage/v1beta1/b/mybucket/o: (400) Required' in /home/www/public_html/abc/google-api-php-client/src/io/Google_REST.php on line 66
What am i doing wrong please help me out..
There is some problem with the way i am sending the parameters. Please if anyone knows help me..
There is an example here :
But that is in Java Please help me to do the same thing in PHP. Please help me out.