python接口测试学习笔记
import requests
import json
import urllib,urllib2
import sys
def baidu_func(url):
headers={}
params={}
req= requests.post(url,headers=headers,params=params)
req.encoding = "utf8"
print(req.text)
print req.content
if __name__ == '__main__':
url="http://www.baidu.com"
baidu_func(url)