随笔分类 - python+requests接口自动化测试
摘要:参考:http://2.python-requests.org/zh_CN/latest/user/advanced.html#advanced 参考:http://2.python-requests.org/zh_CN/latest/api.html#sessionapi
阅读全文
posted @ 2020-02-24 01:20
小白龙白龙马
摘要:参考网址:https://www.cnblogs.com/xiaobaibailongma/p/12346091.html import requests url = 'http://www.baidu.com' resp = requests.get(url) print(resp.cookies
阅读全文
posted @ 2020-02-24 00:25
小白龙白龙马
摘要:import requests url = 'http://httpbin.org/post' wj = {'file':open('C:\\Users\\del\\Desktop\\新建文件夹\\1.jpg','rb')} resp = requests.post(url,files = wj)
阅读全文
posted @ 2020-02-23 23:52
小白龙白龙马
摘要:import requests from requests.auth import HTTPDigestAuth url = 'https://httpbin.org/digest-auth/auth/user/pass' resp = requests.get(url,auth=HTTPDiges
阅读全文
posted @ 2020-02-23 22:58
小白龙白龙马
摘要:import requests from requests.auth import HTTPBasicAuth url = 'https://api.github.com/uesr' resp = requests.get(url,auth=HTTPBasicAuth('user','passwor
阅读全文
posted @ 2020-02-23 22:50
小白龙白龙马
摘要:import requests url = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4' resp = requests.get(url) with open('C:\\Users\\del\\Desktop\\新建文件夹\\3.mp4','
阅读全文
posted @ 2020-02-23 20:44
小白龙白龙马
摘要:import requests url = 'https://www.python.org/ftp/python/3.8.1/python-3.8.1.exe' resp = requests.get(url) with open('C:\\Users\\del\\Desktop\\新建文件夹\\2
阅读全文
posted @ 2020-02-23 19:57
小白龙白龙马
摘要:import requests url = 'https://upload-images.jianshu.io/upload_images/13614258-ba7bc15bccab5c63.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240
阅读全文
posted @ 2020-02-23 19:43
小白龙白龙马
摘要:import requests resp = requests.get('http://httpbin.org/get') print(type(resp.headers)) print(resp.headers['Content-Type']) actual_headers = {} for k,
阅读全文
posted @ 2020-02-23 19:23
小白龙白龙马
摘要:from urllib.parse import quote,unquote d = {'lang':'python','type':'testing','ccountry':quote('中国')} print(d) #执行结果:{'lang': 'python', 'type': 'testin
阅读全文
posted @ 2020-02-23 19:05
小白龙白龙马

浙公网安备 33010602011771号