Bootstrap

{“code“:“ERR_INVALID_PROTOCOL“}

{"code":"ERR_INVALID_PROTOCOL"}

问题场景详述

请求 node service 服务 http://localhost:7001/xx/xx/xxx 时,直接请求线上服务正常;postman 请求本地服务正常,但是直接请求本地服务异常报错 {“code”:“ERR_INVALID_PROTOCOL”}

问题原因及解决办法

请求时使用的 nodejs 的 https 模块,线上是接口是 https 协议没有问题,但是本地是 http 协议,使用 https 模块请求 本地 http 协议的服务所以报错,请求本地 http 协议服务时对应使用 nodejs 的 http 模块即可正常请求,

;