python --- pycurl

pycurl

#!/usr/bin/env python
#-*- coding:utf-8 -*-
import pycurl
import StringIO

c = pycurl.Curl()
c.setopt(pycurl.URL,"http://www.website.com")
c.setopt(pycurl.POST,1)
c.setopt(pycurl.POSTFIELDS,"request=%s" % str('wrapper'))

b=StringIO.StringIO()
c.setopt(pycurl.WRITEFUNCTION,b.write)
c.perform()
c.close()
data = b.getvalue()
print data

你可能感兴趣的:(python,pycurl)