Right way to access the Google Cloud Storage bucket via Public API

Posted by SyBer on Stack Overflow See other posts from Stack Overflow or by SyBer
Published on 2014-06-13T09:20:55Z Indexed on 2014/06/13 9:24 UTC
Read the original article Hit count: 217

I'm trying the following request to access the bucket by using curl, via the public API:

curl -X POST -H 'Content-Type: image/jpeg' -d @xxx.jpeg 'https://www.googleapis.com/upload/storage/v1/b/clips.eyecam.com/o?uploadType=media&name=x.jpeg&key=XXX'

With XXX being the generated key in the Public API.

However I'm getting an authorization failure:

{ "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } }

Seems the request is incorrect and does not pass the authorization key, any idea what would be the right form of the request?

© Stack Overflow or respective owner

Related posts about curl

Related posts about google-api