Postman's interface debug tool automatically sync Chrome cookies, automatic login authentication powerful interface debugging tools -Postman Detailed graphics

Foreword

When the trailing edge separating the development of the former, as a back-end developer, demanding independence after the completion of the development of an interface, developers need to test themselves by submission to the testers for testing, otherwise it will appear to the business process where testers simply a dead end, or BUG will be excessive and so on.

Postman is a perfect interface testing tool that can efficiently help independent developers back-end interface testing.

Postman specific uses can be read: powerful interface debugging tools -Postman Detailed graphics

But part of the task scenarios, part of the api must be logged in to set the cookie to access the call interface, how to avoid before landing, automatic synchronization of browsing login information on the device do?

Scenes:

Client: Postman (version 7.5.0, the latest version is recommended, older versions may not support)

Browser: Chrome (version 76.0.3809.100)

Implementation as follows:

With the release of Postman v7.2, Interceptor back. However, its function changed a little --Interceptor interceptors integrated sync only cookie. Now you can specify the browser field, Interceptor Postman in the cookie will capture these sites and sync them to your Postman instance. You can not use the Interceptor interceptor capture request because the agency has built a postman interceptor enabled.

 

Installation:

First check if you are using a version of Postman v7.2 or higher, such as lower remember version upgrade to the latest version.

Step One: Download and install the corresponding environmental InterceptorBridge interceptor

The download is complete, extract InterceptorBridge_Windows_1.0.0.zip, double-click the file to run install_host.bat that is successfully installed

Step Two: Click the "Satellite Icons" marked at the upper right corner.

 

Step Three: Click "Cookies Beta" tab.

 

第四步:确保“捕获cookie”被切换为橙色的“On”。

你可以看到绿色的“拦截器连接”,输入要捕获cookie的域,然后单击“添加域”。在上面的截图中,您可以看到我添加了https://twitter.com。(注意:只有添加twitter.com才能同步所有子域名的cookie)。

 

 第五步:确保你同时打开了Chrome浏览器,并登录网站。

这样Postman就可以和浏览器进行cookie数据同步(注意如果你是Windows用户,记得重启Chrome)

在请求生成器中,单击右侧的“Cookies”链接。该模式应该显示为您指定的域捕获的所有cookie。

至此,在Postman工具上再次请求接口,即可自动同步cookie,实现自动模拟登陆了。

参考官网资料:https://blog.getpostman.com/2019/06/24/introducing-interceptor-integration-for-native-postman-apps/

 

Guess you like

Origin www.cnblogs.com/wenzheshen/p/11431630.html