【发布时间】:2022-08-03 04:21:28
【问题描述】:
当尝试通过 requests 模块发送 post 请求时,python 会抛出 404 错误。
\"_csrf\": _csrf,
\"staffUnit\": \"60\",
\"position\": \"1217\",
\"employmentDate\": \"01.08.2022\"
}
site = \"https://umschool.tech/staff-schedule/schedule-new\"
for i in range(1):
response = session.post(site, data=data)
print(\"JSON Response \", response.json())
输出:{\'时间戳\':\'2022-08-01T11:18:51.177+00:00\',\'状态\':404,\'错误\':\'未找到\',\'消息\':\",\'路径\':\'/staffing/schedule-new\'}
我是这个话题的新手,所以我不明白为什么会这样。先感谢您。
-
我想您需要有关 API 的更多信息。也许路径 \'/staffing/schedule-new\' 没有为 POST 请求设置。您是否尝试过使用 Postman 应用程序?
-
@Tbi,是的,我尝试使用 Postman,并且成功,也许我应该更改标题?
-
您是否还使用 Postman 为您生成 Python 代码?
标签: python post python-requests http-status-code-404