Article directory
Preface
Postman is a popular API development tool and collaboration platform. It provides a user-friendly interface for creating, testing, debugging, and documenting APIs.
1. How does Postman add tokens?
Let me take my own blog homepage as an example.
1. Query the token information in the browser
Query the token value of the corresponding web page in Application->Local Storage->Key and Value.
2. Convert the token in the browser into the token value in Postman
Convert the keys and values in the browser to the following format one by one
// 将数据添加到请求头部
pm.request.headers.add({
key:'密钥1',
value:'值1',
key:'密钥2',
value:'值2',
});
3. Add request in Postman
Through the network function in the browser, we can see that the address we need to request is: https://blog.csdn.net/biyn9?type=blog, the request method is: get, then the same needs to be the same in Postman. Otherwise, the data cannot be queried.
Select the Pre-request function, copy the token information converted above, and click send to query the data.
Summarize
This article mainly introduces how postman adds token information and the whole process of querying it. I hope it will be helpful to you.