Python请求模块post返回200但未写入数据

Python请求模块post返回200但未写入数据,python,python-requests,Python,Python Requests,我正在使用Python 3.7和请求模块2.22.0 以下是我用python编写的代码: data = { "id": 35, "name": "sample", "user": 1, "account": 3, "auto_remove_resource": "N", "generations": 30, "enabled": True, "schedules": [1], "description": "" } response = requests.post( url=url, js

我正在使用Python 3.7和请求模块2.22.0

以下是我用python编写的代码:

data = { "id": 35, "name": "sample", "user": 1, "account": 3, 
"auto_remove_resource": "N", "generations": 30, "enabled": True, 
"schedules": [1], "description": "" }

response = requests.post( url=url, json={"json_payload": data}, 
headers=headers, verify=False )

print(response.status_code)
它返回200表示执行get,但返回301表示post请求。同样的帖子也适用于邮递员

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): 
DEBUG:urllib3.connectionpool: "POST url HTTP/1.1" 301 0 
DEBUG:urllib3.connectionpool:"GET url HTTP/1.1" 200 3718 200
我给出了以下标题

headers = { "Accept": "application/json;", "Content-Type": 
"application/json", "Authorization": "Bearer {}".format(mytoken), }

如果您有任何帮助,我们将不胜感激。

请检查服务器日志(以及其中的错误处理)。在“邮递员”中有一个“代码”按钮,单击该按钮,在选项之间选择“python->Requests”,然后将输出与您的代码进行比较。Sukh,您可以分享您的邮递员收藏吗,因此,我可以查看请求并帮助解决此问题。感谢您的回复,我通过在“Accept”的标题中使用1.3版解决了此问题。现在,我的授权代码如下所示:headers={“Accept”:“application/json;version=1.3”,“Content Type”:“application/json”,“Authorization”:“Bear{}”。format(mytoken),}这就解决了问题。我认为这可能与服务器端代码的兼容性有关。谢谢你的快速回复