在Postman查询中添加会话Cookie。

huangapple go评论77阅读模式
英文:

Add session cookie in Postman query

问题

我想对一个 API 端点提交 GET 请求,但我不知道如何添加会话 cookie,以便我的请求成功,我通过身份验证。当我发送请求时,我收到如下内容:

{
    "timestamp": "2020-04-07T14:39:56.070+0000",
    "status": 401,
    "error": "Unauthorized",
    "message": "Unauthorized",
    "path": "/api/fridge/recommended-dishes"
}
英文:

I want to submit a GET request against an api endpoint but I dont know how to
add the session cookie so my request is successful
and I get through the authentication. When I send my request, I get this:

{
    "timestamp": "2020-04-07T14:39:56.070+0000",
    "status": 401,
    "error": "Unauthorized",
    "message": "Unauthorized",
    "path": "/api/fridge/recommended-dishes"
}

答案1

得分: 0

你需要在Postman中启用Cookie拦截器。详细信息请查看https://learning.postman.com/docs/postman/sending-api-requests/interceptor/。

英文:

You have to enable cookie interceptor in postman https://learning.postman.com/docs/postman/sending-api-requests/interceptor/

huangapple
  • 本文由 发表于 2020年4月8日 23:17:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/61104140.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定