Debian Codegraph @

examples/quickstart/file_upload_real.py

raw
1 #! /usr/bin/env python
2 # vi:ts=4:et
3
4 import pycurl
5
6 c = pycurl.Curl()
7 c.setopt(c.URL, 'https://httpbin.org/post')
8
9 c.setopt(c.HTTPPOST, [
10 ('fileupload', (
11 # upload the contents of this file
12 c.FORM_FILE, __file__,
13 )),
14 ])
15
16 c.perform()
17 c.close()