X7ROOT File Manager
Current Path:
/opt/hc_python/share/doc/pycurl/examples/quickstart
opt
/
hc_python
/
share
/
doc
/
pycurl
/
examples
/
quickstart
/
📁
..
📁
__pycache__
📄
file_upload_buffer.py
(311 B)
📄
file_upload_real.py
(291 B)
📄
file_upload_real_fancy.py
(483 B)
📄
follow_redirect.py
(250 B)
📄
form_post.py
(564 B)
📄
get.py
(583 B)
📄
get_python2.py
(447 B)
📄
get_python2_https.py
(498 B)
📄
get_python3.py
(403 B)
📄
get_python3_https.py
(454 B)
📄
put_buffer.py
(472 B)
📄
put_file.py
(300 B)
📄
response_headers.py
(2.05 KB)
📄
response_info.py
(498 B)
📄
write_file.py
(357 B)
Editing: get_python3.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) c.perform() c.close() body = buffer.getvalue() # Body is a byte string. # We have to know the encoding in order to print it to a text file # such as standard output. print(body.decode('iso-8859-1'))
Upload File
Create Folder