Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 获取axios reactJs中的net::ERR_SSL_PROTOCOL_错误_Node.js_Reactjs_Axios - Fatal编程技术网

Node.js 获取axios reactJs中的net::ERR_SSL_PROTOCOL_错误

Node.js 获取axios reactJs中的net::ERR_SSL_PROTOCOL_错误,node.js,reactjs,axios,Node.js,Reactjs,Axios,我在reactJs中得到了对Node.js服务器的请求,如下所示 const response = await axios.get("http://xx.xx.xx.x:3002/api/products/allTimers/", { headers: { 'Authorization': 'Bearer ' + this.state.authorization_token }

我在reactJs中得到了对Node.js服务器的请求,如下所示

const response =
            await axios.get("http://xx.xx.xx.x:3002/api/products/allTimers/",
                {
                    headers: { 'Authorization': 'Bearer ' + this.state.authorization_token }
                }
            )
控制台由

xhr.js:178 GET https://xx.xx.xx.x:3002/api/products/allTimers net::ERR_SSL_PROTOCOL_ERROR
dispatchXhrRequest @ xhr.js:178

createError.js:16 Uncaught (in promise) Error: Network Error
    at createError (createError.js:16)
    at XMLHttpRequest.handleError (xhr.js:83)
如何解决此问题。

如果使用https,则需要向服务器提供其他凭据。但是,您在GET请求中使用了http://所以这看起来很奇怪,因为它会要求您这样做。如果您使用https,您需要向服务器提供额外的凭据。然而,您在GET请求中使用了http://所以它要求这样做看起来确实很奇怪