如何为我的 access_token 提供 python
How do I provide my access_token with python
request = requests.get(f"https://api.mercadopago.com/v1/payments/{id}")
https://i.stack.imgur.com/Iqrsw.png
有没有办法对请求执行此操作?
根据此 https://www.mercadopago.com.ar/developers/en/reference/payments/_payments_id/get
您需要提供一个 header 以及您通过 OAUTH 获得的访问令牌。然后一旦你获得了访问令牌,你就可以做
header = {"Authorization": "Bearer " + "your access token"}
result = requests.get(f"https://api.mercadopago.com/v1/payments/{id}", headers=header)
这将 return 你 json 结果
request = requests.get(f"https://api.mercadopago.com/v1/payments/{id}")
https://i.stack.imgur.com/Iqrsw.png
有没有办法对请求执行此操作?
根据此 https://www.mercadopago.com.ar/developers/en/reference/payments/_payments_id/get
您需要提供一个 header 以及您通过 OAUTH 获得的访问令牌。然后一旦你获得了访问令牌,你就可以做
header = {"Authorization": "Bearer " + "your access token"}
result = requests.get(f"https://api.mercadopago.com/v1/payments/{id}", headers=header)
这将 return 你 json 结果