简体   繁体   中英

getting net::ERR_SSL_PROTOCOL_ERROR in axios reactJs

I've get request in reactJs to Node.js server given below

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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