flexpeace / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

insert succeeds, insert_media results in 400. #259

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
## Steps ##
BUCKET = 'google-cloud-storage-bucket-you-have-write-access-to'
uploader = apiclient.http.MediaIoBaseUpload(io.BytesIO('foo'), 
mimetype='text/html')
storage.objects().insert_media(
    bucket=BUCKET, name=OBJ, media_body=uploader).execute()

result: 400

## Expected ## 

Successful upload (changing insert_media to insert works).

## Environment ## 

linux, pip install google-api-python-client

Original issue reported on code.google.com by fe...@google.com on 8 Apr 2013 at 10:57

GoogleCodeExporter commented 8 years ago
The exception raised should be an HttpError object that contains both
the response object and the content, can you provide the info in those?

Original comment by jcgregorio@google.com on 12 Apr 2013 at 2:52

GoogleCodeExporter commented 8 years ago
Emailed you this info

Original comment by fe...@google.com on 12 Apr 2013 at 5:40