Google-api-ruby-client: Unable to upload to Storage_v1 API

Created on 27 Jun 2016  路  4Comments  路  Source: googleapis/google-api-ruby-client

Attempting to upload a file through the gem to the storage api results in a Google::Apis::ClientError: parseError: This API does not support parsing form-encoded input. error.

storage.insert_object(bucket_name, nil, { name:'test_test.tar.gz.gpg', upload_source: File.open(file_path,'rb')})

is the command that I am trying to run. This line appears to be setting the content-type to form-encoded

Which is trigger right above it because the body is empty, which is empty because here

Thanks for any help.

triage me bug

Most helpful comment

FWIW, should be able to work around it by specifying the name in the body instead of query param.

storage.insert_object(bucket_name, { name: 'test_test.tar.gz.gpg' }, upload_source: File.open(file_path,'rb'))

All 4 comments

Whoops guess I should have added this in the initial comment. @sqrrrl

FWIW, should be able to work around it by specifying the name in the body instead of query param.

storage.insert_object(bucket_name, { name: 'test_test.tar.gz.gpg' }, upload_source: File.open(file_path,'rb'))

Thank you that will work!! I owe you a 馃嵑

Looks like this issue is resolved.

I'll add for any future search results to use https://github.com/GoogleCloudPlatform/google-cloud-ruby for the Cloud Storage API

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jponc picture jponc  路  5Comments

jiggneshhgohel picture jiggneshhgohel  路  6Comments

ProbablyRusty picture ProbablyRusty  路  5Comments

olegpanchenko picture olegpanchenko  路  3Comments

MattMencel picture MattMencel  路  3Comments