Angular 4错误:通过IP地址向节点发送http请求时:Err连接被拒绝

时间:2018-05-06 07:57:29

标签: angular httprequest ip-address connection-timeout

我正在向节点发送Angular http IP请求并收到错误: net :: ERR_CONNECTION_TIMED_OUT 。 从过去的1个月开始,代码运行良好,突然之间就破了。我可以通过localhost和其他外部Api以及除IP地址请求之外的所有工作状态发送请求。 我已经交叉检查了portNo和我发送请求的IP,一切似乎都是正确的。

任何人都可以帮助我。!!这对我来说是非常奇怪的情况。

附上错误和一些代码。如果您还有其他需要,请告诉我。

//在我的addPropertyService服务中:

getDetails() {

    const headers = new Headers({
        'Content-Type': 'application/json',
        'authToken': 'eyJ0eXAiOiJKV1QiLCJh'
    });

    return this.http.get('http://172.16.10.68:8080/api/property', { headers: headers })
        .map((response: Response) => {
            const result = response.json();
            console.log('Response in service: ', result);
            return result;
        })

}

//在componentsnet

onSearch(){
this.addPropertyService.getDetails()
            .subscribe(data => {
                this.Data = data;
            })
}

myConsole Error screenshot

0 个答案:

没有答案