[Question] Browser get request with token

Scenario: Interface access must require security verification. All requests will be made with a token in the header for each access. When we make a get request, we can directly access it through a browser. The default browser access is a get request. Now There is an import function. When using the interface access tool postman and other tests, the return will be binary, which is not the file stream I want, but if you want to access it with a browser, you need to bring a token. This article records how to make it The token is included in the header when the browser accesses.

Preparation tools:

  • Google Chrome 
  • modify-headers-for-google plugin

The modify-headers-for-google plug-in needs to be downloaded from the Google store, but it cannot be downloaded without going over the wall. I recommend another download store for extension fans  .

1. Unzip after downloading and get a crx file

2. Enter the Google store, enter the extension management

3. Turn on developer mode

4. Drag the crx file directly into the interface

 

5. Click the pushpin button

 

6. Generate shortcut icons

 

7. Click to enter the plug-in interface

 8. Click the plus sign in the upper right corner to generate a new line of input boxes, fill in the following parameters, and set the action to add. The name and value are entered by themselves, my requirement is to add token in the header

9. After completing the filling, click the save button

10. Click the enable button

 

11. Finally, click the enable button in the upper left corner

12Test it:

Result: The browser get request header carries the token and the call is successful.

 

 

Guess you like

Origin blog.csdn.net/weixin_56995925/article/details/125991112