sendgrid / python-http-client

Twilio SendGrid's Python HTTP Client for calling APIs
https://sendgrid.com
MIT License
126 stars 101 forks source link

How to upload a file? #12

Closed mirror222 closed 7 years ago

mirror222 commented 8 years ago

I was trying to upload a file to an openstack (swift), it it failed:

url = 'http://192.168.1.100:8080/v1/AUTH_xxxxxxxxxxxxxxxxxxxx/container1/test.jpg' files = {'file': open('test.jpg', 'rb')} r = client.put(url, request_body=files, request_headers=headers)

any advice? thank you

thinkingserious commented 8 years ago

Hello @mirror222,

What is the error message?