限时免费试用:欢迎注册 api.bigmodel.org ,快速体验大模型 API 接入服务。
当前位置:首页 >开发者 >其他技术 >Python

py request 基础

分类:Python时间:2019-11-19浏览:2045
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 = {}

)

本站文章如未注明出处均为原创,转载请注明出处,如有侵权请邮件联系站长。
0/500
Share your thoughts respectfully.