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)
posted @ 2017-07-06 10:07  yoyo889  阅读(131)  评论(0编辑  收藏  举报