py request 基础

``` import requests #常用的形式 # requests.get() # requests.post() # requests.put() # requests.request('post') # 参数 # url='xxx', # params={'name':11,'pwd':1212}, # cookies = {}, # headers = {}, # data={}, # json={} # get # requests.get( # url='xxx', # params={'name':11,'pwd':1212}, # cookies = {}, # headers = {} # ) #post requests.post( url='xxx', params={'name':11,'pwd':1212}, cookies = {}, headers = {}, data={}, json={} ) #session 容器 自动加入参数 session = requests.Session() re = session.post( url='aaa.php', data = {} ) ``` > 更多精彩文章请关注 [王明昌博客](https://www.wangmingchang.com)
posted @ 2019-11-19 21:32  程序员子枫  阅读(470)  评论(0编辑  收藏  举报