

For the interface test of other scenarios, you can ignore me. summaryįor the scenarios that really need to obtain web cookies to complete the interface test, the above methods have certain convenience, and it is also necessary to use my methods. But… It’s been more than two years since this petition was posted, and just hours to a few days before I expressed my request, people have been petitioning one after another, so I don’t know if it will be true. If you really want postman to add the above functions to their desktop version, you can go to their official GitHub issues to petition, and they are collecting your opinions. On the other hand, considering that Chrome browser will stop supporting chrome apps in the near future, it may not last long. Note: Interceptor feature is supported only in our Postman Chrome Apps and is not available in Postman Desktop Apps at the moment. Compared with the desktop version, the function of this version is naturally less. Therefore, if you want to use the above functions, you can only install the postman chrome app back. Unfortunately, according to the official instructions, the cookie sharing of postman interceptor can’t support the independently installed desktop version (downloaded from the official rather than from the chrome application market). In this way, we can easily get the network requests we need to test directly in postman, instead of filling in parameters by ourselves.

Bonus of postman interceptorĪnother thing about postman interceptor is that its Request CaptureIt supports capturing the request records in the Chrome browser and automatically syncing them to the postman chrome app. Yes, because Chrome has exited the login, postman will lose the login status naturally, which means that the cookies on both sides are synchronized. Let’s log out from GitHub first, or the request just now. That is to say, at this time, although we didn’t make special cookie settings for postman, the login state of its request was verified by the server, and the cookie sharing was successful! What if you log out of the browser at this time? directly simulate the request notification interface in postman chrome app Log in to GitHub website normally in Chrome browser (there is nothing to demonstrate in this step) IV. Start postman, and open chrome Interceptor at the small satellite icon in the upper right cornerģ. confirmation Postman InterceptorPlug in installed successfully (as shown in the figure)Ģ. Let’s take GitHub as an example to demonstrate how to share cookies. I only post the screenshot of the official software interface. Please install the following tools by yourself. Combined with the tools introduced in this article, you can share cookies seamlessly between the postman chrome app (why is it emphasized to be postman chrome app, which will be explained at the end of this article) and the Chrome browser, and this sharing process is transparent to users. However, sometimes the interface test needs to be prepared with login state or other state data, which often exists in the browser cookie. In the interface test, everyone’s favorite tool list, there must be postman. The cookies you set will be sent by Chrome along with your request.As a web engineer, the most familiar daily work is the background interface development and joint debugging test. Include the “Cookie” header in the headers sectionģ. Each cookie object will contain the following properties:ĭomain, hostOnly, httpOnly, name, path, secure, session, storeId, valueĢ. To retrieve a particular name, use “postman.getResponseCookie(cookieName)”. This will return an array of cookie objects.

Recall we learned that if you are installing the application from chrome then a separate interceptor is required for the proxy server. Importing a collection is the most common among all.

In the tests section (Jetpacks must be enabled for this), you can use the “responseCookies” object. As can be seen from the image it allows you to import a Postman Collection, Environment, Curl command, etc. Make sure the interceptor is enabled in Postman – Check that the traffic light icon in the top-right corner is green. With the interceptor on, you can retrieve cookies set on a particular domain (Jetpacks only), and include cookies while sending requests.ġ. With the new version of Postman (1.0.2), and the Postman Interceptor (0.2.7), it is now possible to read and write cookies!
