与邮递员发送cookie [英] Sending cookies with postman

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

问题描述

我阅读了与邮递员一起发送带有cookie的请求的手册:

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


由于打包的应用在与浏览器分开的沙箱中运行,
无法访问浏览器中设置的cookie。使用Interceptor扩展也可以克服
的限制。邮递员通过拦截器路由所有
请求,然后使用浏览器上下文
发送请求。浏览器中设置的Cookie会自动
附加到您的请求中。阅读有关拦截器的原始博客文章。

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.

启用拦截器后,还可以从
Postman发送cookie。只需设置 Cookie标头,就会将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

因此,我为Google chrome下载了拦截器,并启用了该拦截器。

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.

我做错了什么?

推荐答案

您可以在以下位置启用拦截器浏览器和邮递员分开。对于发送/接收cookie,您应该在Postman中启用Interceptor。因此,如果仅在浏览器中启用拦截器,则将无法使用。实际上,如果您不想在不必要的请求中充斥邮递员历史记录,则根本不需要在浏览器中启用拦截器。

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.

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

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