Python库之Requests(iMooc)---(3)
来源:互联网 发布:记录恋爱的软件 编辑:程序博客网 时间:2024/06/04 19:26
啊嘞,这次是一个小小的requests程序,直接上代码,好想没什么好说的~
import requestsURL_IP = 'http://127.0.0.1:8000/ip'URL_GET = 'http://127.0.0.1:8000/get'def simple_requests(): response = requests.get(URL_IP) print '>>>>>Response Headers:' print response.headers print '>>>>>Response Body:' print response.textdef use_params_requests(): params = {'param1':'hello', 'param2':'world'} response = requests.get(URL_GET, params=params) print '>>>>>Response Headers:' print response.headers print '>>>>>Response Status Code:' print response.status_code print '>>>>>Response Body:' print response.textif __name__ == '__main__': print '>>>>>Simple_Requests:' simple_requests() print print '>>>>>Use_Params_Requests:' use_params_requests()requests的可读性超强啊……
------Python大法好:)------
阅读全文
0 0
- Python库之Requests(iMooc)---(3)
- Python库之Requests(iMooc)---(1)
- Python库之Requests(iMooc)---(2)
- Python库之Requests(iMooc)---(4)
- Python库之Requests(iMooc)---(5)
- Python之requests库
- python库之requests
- python学习之 requests库
- Python学习之Requests库
- python简洁之道-----Requests库
- Python网络爬虫之Requests库
- Python爬虫之requests
- python之requests篇
- Python之,requests包
- python爬虫之requests
- python requests库 笔记
- python requests库介绍
- python安装requests库
- 排序:冒泡与选择的改进
- python3.0网络编程
- 1144: n的合成
- libvmi安装_Ubuntu_14.04
- python学习之路-基础篇-函数-day03
- Python库之Requests(iMooc)---(3)
- Python读取txt内容写入xls格式的excel中
- UVA10003CuttingSticks
- spring junit测试找不到SpringJUnit4ClassRunner.class
- 电脑开机显示checking file system on c
- BFPRT算法(求前k个小的数)-Java实现
- 利用powerDesigner16.5连接oracle数据库并自动生成表结构图
- redis清空数据
- 使用javaMail进行腾讯,新浪,网易网上邮箱验证