简体   繁体   English

在 axios reactJs 中获取 net::ERR_SSL_PROTOCOL_ERROR

[英]getting net::ERR_SSL_PROTOCOL_ERROR in axios reactJs

I've get request in reactJs to Node.js server given below我在 reactJs 中收到对 Node.js 服务器的请求,如下所示

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

and the console is given by控制台由

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)

how to solve this issue.如何解决这个问题。

Riza's answer worked for me, just a silly mistake by adding 's' to http request. Riza 的回答对我有用,只是在 http 请求中添加“s”是一个愚蠢的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM