postman(十一):添加cookie

时间:2023-03-09 04:56:05
postman(十一):添加cookie

有些接口在调用时,需要提供权限,如下

postman(十一):添加cookie

这个时候可以通过添加cookie的方式跳过验证

为了更方便地获取cookie等信息,可以在chrome中安装一个插件:Postman Interceptor,配合postman一起使用,在网页中发送的请求会先经过Postman Interceptor,会显示出网页请求的详细参数(请求头、cookie之类)

请自行安装Postman Interceptor

安装完成后,具体操作步骤如下:

1.打开postman,开启 Interceptor

postman(十一):添加cookie

2.用浏览器打开需要获取cookie的网页(在网页请求一个页面),然后打开postman的History标签,可以看到Interceptor截取到的请求

postman(十一):添加cookie

3.将得到的cookie添加到要测试接口的请求头中

postman(十一):添加cookie

这样即可跳过验证,成功发送请求