/
/
opt
/
hc_python
/
share
/
doc
/
pycurl
/
examples
/
quickstart
Server: server63.web-hosting.com (198.54.116.184)
You: 216.73.216.187
PHP 7.4.33
Dir:
/opt/hc_python/share/doc/pycurl/examples/quickstart
Edit:
/opt/hc_python/share/doc/pycurl/examples/quickstart/get_python2_https.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl import certifi from StringIO import StringIO buffer = StringIO() 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.setopt(c.CAINFO, certifi.where()) c.perform() c.close() body = buffer.getvalue() # Body is a string in some encoding. # In Python 2, we can print it without knowing what the encoding is. print(body)
Ukuran: 498 B