Provisional headers are shown using Axios requests

In the process of using vue development, we may encounter problems when using axios to send requests. Let me share the problems and solutions I encountered, hoping to help you.

Not much nonsense, just look at the question:

Description of the problem: This problem literally means "the temporary header is displayed". The browser sends this request for the first time, but the request is blocked and no response is received. When the browser is asked to send this request again, the last agreed request has not received a response, and the browser will report this warning. In other words, the request is not sent

Cause Analysis

1. The cross-domain request is intercepted by the browser

There are many situations in which this happens, but the reasons are various. Generally, there are several situations: the static resources of the website now exist under a special static domain name and the domain name actually visited may be inconsistent.

2. The server did not respond in time (timeout)

It will only appear in this specific situation and has little to do with the server.

3. The request is blocked by a browser plug-in (mostly due to ad blocking tools, you can set a relevant whitelist)

As a developer, my friends must have installed a lot of plug-ins on Chrome. We can view the plug-ins we installed through chrome://extensions/, as shown below:

We found that we installed an ad-blocking plug-in, and here we turned it off first. Or set the relevant whitelist configuration.

There is no error reported just now, and the data is also requested. 

Guess you like

Origin blog.csdn.net/qq_41322460/article/details/122438599