python - Python API 请求
问题描述
我是 Python API 的新手,我正在尝试从端点检索数据,但我不断收到错误 400 错误请求我做错了什么?
这是我的代码:
import requests
payload = {
"header" : {
"cookie" :""
},
"body": {
"email": "customer@****.com",
"password": "****"
}
}
headers = {
'Host': 'https://ije-api.tcore.xyz',
'User-Agent': 'PostmanRuntime/7.18.0',
'Accept': 'application/json',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'Referer': 'https://ije-api.tcore.xyz',
'Content-Type':'application/json',
'X-Requested-With': 'XMLHttpRequest',
'Connection': 'keep-alive',
}
request = requests.post("https://ije-api.tcore.xyz/v1/auth/login", json = payload, headers=headers)
print(request.text)
解决方案
推荐阅读
- amazon-web-services - 从 avro 文件复制时导入 SUPER 列失败
- android - 失去与设备的连接。在 Flutter 中添加 video_player 包后
- odoo - 所选公司与相关用户的公司不兼容
- python - 对如何让不和谐机器人发送一定数量的消息感到困惑?
- javascript - 动画徽标从角落飞到屏幕中心
- python - 通过 Keras 加载自定义数据集
- validation - 只允许整数,但显示为 '.' 千篇一律,便于阅读
- powerbi - 基于每天行数的 DAX 滚动平均值
- java - 如何在 Android Studio Activity 中设置布局和视图的内容?
- r - 使用中值创建新数据框(按行子集)