How does postman add token information?


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.
insert image description here

1. Query the token information in the browser

Query the token value of the corresponding web page in Application->Local Storage->Key and Value.
insert image description here

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.
insert image description here
insert image description here

Select the Pre-request function, copy the token information converted above, and click send to query the data.
insert image description here

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.

Guess you like

Origin blog.csdn.net/biyn9/article/details/131458479