I use the following link to use Google Cloud Storage:
Google cloud
I want to load an object using the insert function specified in the above API. I am using PHP. The code I use 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 get an error like:
Fatal error: throw a "Google_ServiceException" exception with the message "Error while calling POST https://www.googleapis.com/storage/v1beta1/b/mybucket/o : (400) Requires' in / home / www / public_html / abc / google-api-php-client / src / io / Google_REST.php on line 66
What am I doing wrong, help me ...
There is some problem with the way I submit the parameters. Please, if anyone knows, help me ..
Here is an example:
Example
But this is in Java. Please help me do the same in PHP. Please help me.
source share