Postman 中的 Cookie 与 Set-Cookie 标头 [英] Cookie vs Set-Cookie Header in Postman

查看:36
本文介绍了Postman 中的 Cookie 与 Set-Cookie 标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么 Postman(chrome 扩展)不支持更传统的Set-Cookie"标头.我尝试使用Set-Cookie"作为键和cookie_name=cookie_value"作为值发送 cookie,但服务器没有获取 cookie 信息.

Why doesn't Postman (chrome extension) support more traditional "Set-Cookie" header. I have tried sending cookies using "Set-Cookie" as key and "cookie_name=cookie_value" as value, but server did not get the cookie information.

我用Cookie"作为键重试,它成功了.

I retried with "Cookie" as the key and it worked.

看起来它支持Cookie"标头.为什么是Cookie"和Cookie 2"而不是更传统的Set-Cookie"?

It looks like it supports "Cookie" header instead. Why "Cookie" and "Cookie 2" instead of more traditional "Set-Cookie"?

推荐答案

通常消费者(无论是浏览器还是邮递员)通过 Cookie 标头向服务器发送 cookie.

Usually a consumer (be it a browser or Postman) sends cookies to the server via the Cookie header.

想要通知消费者设置 cookie 的服务器将通过 Set-Cookie 标头发送它.

A server that wants to inform a consumer to set a cookie, will send it via the Set-Cookie header.

来源:思科在其问答文章

这篇关于Postman 中的 Cookie 与 Set-Cookie 标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆