httplib-Python
Posted Adam_LBQ
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了httplib-Python相关的知识,希望对你有一定的参考价值。
#coding:utf-8 import htmllib import httplib2 import httplib h1 = httplib.HTTPConnection("www.python.org") h1.request("GET", "/") r1 = h1.getresponse() print r1.status, r1.reason data1 = r1.read() print data1 import httplib, urllib params = urllib.urlencode({‘@number‘: 12524, ‘@type‘: ‘issue‘, ‘@action‘: ‘show‘}) headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"} conn = httplib.HTTPConnection("bugs.python.org") conn.request("POST", "", params, headers) response = conn.getresponse() print response.status, response.reason data = response.read()
以上是关于httplib-Python的主要内容,如果未能解决你的问题,请参考以下文章