如何使用python从API获取数据 由 御林军发布于 2020-05-24 03:02:01 pythonapi 收藏 我必须使用python从rest api获取数据。如何发送标头以从API检索数据。是否有用于从API请求数据的模块。 评论 请 登录后发表观点 请勿打扰 2020-05-24 03:02:01 Yes python has requests lib to make a call to POST and GET methods 例如 import requests url = 'web address' params = {'key':'value'} r = requests.get(url = URL, params = PARAMS) response = r.json() 点赞 评论 雅典娜 2020-05-24 03:02:01 Try requests it has two method get() and post() 请试试: import requests import json res = requests.get('paste your link here') response = json.loads(res.text) 点赞 评论 到底啦
Yes python has
requests
lib to make a call to POST and GET methods例如
Try
requests
it has two methodget()
andpost()
请试试: