Lispython / human_curl

Simple Human wrapper for cURL library
http://h.wrttn.me/human_curl
Other
205 stars 43 forks source link

Data never gets added to POST when uploading files #14

Closed ludoo closed 10 years ago

Lispython commented 12 years ago

Can you show example of usage? Any reasons to use lists instead tuple or dict?

ludoo commented 12 years ago

It's not that I prefer using lists, it's that by the time data gets there, it has been wrapped in a list, so it will never be a tuple or dict. If you check for tuples or dicts, data passed gets never sent, only the files.

response = requests.post(
    url='https://graph.facebook.com/%s/photos?access_token=xxxxxxxx',
    data=dict(
        message='Text message accompanying picture',
    ),
    files=dict(
        source=file('/tmp/picture.jpg'),
    ),
)
Lispython commented 10 years ago

Fixed by #32 pull_request.