用邮递员发送饼干 [英] Sending cookies with postman

查看:35
本文介绍了用邮递员发送饼干的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了使用邮递员发送带有 cookie 的请求的手册:

I read the manual of sending request with cookie with postman:

由于打包的应用程序在与浏览器分开的沙箱中运行,它无法访问浏览器内设置的 cookie.这个限制可以也可以使用拦截器扩展来克服.邮递员路由所有通过拦截器请求,然后使用浏览器上下文发送请求.浏览器内设置的cookies是自动的附在您的请求中.阅读 Interceptor 上的原始博文.

As the packaged app runs in a sandbox separately from the browser, it can not access cookies set inside the browser. This restriction can also be overcome using the Interceptor extension. Postman routes all requests through the Interceptor, which then uses the browser context to send requests. Cookies set inside the browser are automatically attached to your requests. Read the original blog post on Interceptor.

一旦启用拦截器,您还可以从邮差.只需设置Cookie"标头,cookie就会被发送随着请求.您还可以访问返回响应时可用.查看博客文章更多

Once the interceptor is enabled, you can also send cookies from Postman. Just set the "Cookie" header, and the cookie will be sent with the request. You can also get access to cookies that are available when the response is returned. Check out out blog post for more

所以我下载了谷歌浏览器的拦截器,并启用了.

So I downloaded the interceptor for google chrome, and it enable.

另外,我向邮递员添加以下内容:Cookie JSESSIONID=daczcz36789

Also, I add the following to postman: Cookie JSESSIONID=daczcz36789

当我查看网络时,我注意到没有发送 Cookie.

When I look at the network I notice that the Cookie is not sent.

我做错了什么?

推荐答案

您可以分别在浏览器和 Postman 中启用拦截器.对于发送/接收 cookie,您应该在 Postman 中启用拦截器.所以如果你只在浏览器中启用拦截器 - 它不会工作.实际上,您根本不需要在浏览器中启用拦截器 - 如果您不想用不必要的请求淹没您的邮递员历史记录.

You can enable Interceptor in browser and in Postman separately. For send/recieve cookies you should enable Interceptor in Postman. So if you enable interceptor only in browser - it will not work. Actually you don't need enable Interceptor in browser at all - if you don't want to flood your postman history with unnecessary requests.

这篇关于用邮递员发送饼干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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