Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用邮递员创建POST请求_Post_Http Post_Postman_Restful Architecture_Restful Authentication - Fatal编程技术网

使用邮递员创建POST请求

使用邮递员创建POST请求,post,http-post,postman,restful-architecture,restful-authentication,Post,Http Post,Postman,Restful Architecture,Restful Authentication,此curl工作正常,并按预期返回令牌: curl -X POST -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{ "username": "pere.peris@gmail.com","password": "password" }' "http://75.90.255.68:1133/canPeris/auth" 但是,当我

此curl工作正常,并按预期返回令牌:

curl -X POST -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{ "username": "pere.peris@gmail.com","password": "password" }' "http://75.90.255.68:1133/canPeris/auth"
但是,当我使用Postman应用程序进行相同的调用时,我会得到一个401作为返回值


您应该在正文中添加缺少的JSON。单击原始组合框并添加

{ "username": "pere.peris@gmail.com","password": "password" }

您应该在正文中添加缺少的JSON。单击原始组合框并添加

{ "username": "pere.peris@gmail.com","password": "password" }

您可以使用Postman中的函数生成卷曲:

在右侧的“发送”和“保存”下,只需点击代码按钮/链接。然后在下拉列表的下一个窗口中选择“卷曲”。因此,您可以看到将生成什么样的cURL,并将其与命令行进行比较


此处介绍了
-d
选项:

您可以使用Postman中的函数生成卷曲:

在右侧的“发送”和“保存”下,只需点击代码按钮/链接。然后在下拉列表的下一个窗口中选择“卷曲”。因此,您可以看到将生成什么样的cURL,并将其与命令行进行比较

此处描述了
-d
选项: