PATH:
opt
/
hc_python
/
share
/
doc
/
pycurl
/
examples
/
quickstart
#! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) # For older PycURL versions: #c.setopt(c.WRITEFUNCTION, buffer.write) c.perform() c.close() body = buffer.getvalue() # Body is a string on Python 2 and a byte string on Python 3. # If we know the encoding, we can always decode the body and # end up with a Unicode string. print(body.decode('iso-8859-1'))
[-] form_post.py
[edit]
[+]
__pycache__
[-] response_headers.py
[edit]
[-] put_file.py
[edit]
[-] put_buffer.py
[edit]
[-] file_upload_buffer.py
[edit]
[-] get_python3_https.py
[edit]
[-] get.py
[edit]
[-] write_file.py
[edit]
[+]
..
[-] response_info.py
[edit]
[-] follow_redirect.py
[edit]
[-] get_python2_https.py
[edit]
[-] file_upload_real_fancy.py
[edit]
[-] get_python2.py
[edit]
[-] file_upload_real.py
[edit]
[-] get_python3.py
[edit]