来自AngularJs中PHP的net :: ERR

编程入门 行业动态 更新时间:2024-10-19 20:39:33
本文介绍了来自AngularJs中PHP的net :: ERR_EMPTY_RESPONSE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的PHP项目中有付款部分,其中使用AngularJs在前端显示来自API的付款响应。 CURL用于从PHP端调用付款API。从付款API获得响应后,我将相应地更新数据库。

I have payment section in my PHP project where payment response from the API is displayed in the frond-end using AngularJs. CURL is used for calling payment API from PHP end. After getting the response from payment API, I am updating the Database accordingly.

我发现的问题是,我一直没有不断获得角度方面的API响应即使所有支持的功能都正常工作。

The issue what i found is, I haven't continuously getting the API response in the angular side even-if all the backed functionalities are working properly.

我检查了许多浏览器的网络标签,但在每种故障情况下我都没有响应,但返回-end DB正在正确更新。

I have checked with many browser network tab, but in every failure case i have't got a response, but back-end DB is updating properly.

在每种成功和失败的情况下(失败的意思是,在angularjs HTTP POST请求中没有得到响应),我已经在JSON响应中记录了在这两种情况下,PHP端(将发送到有角的端作为响应)似乎都相似。

Also in every success and failure case (failure means, Not getting response in angularjs HTTP POST request ), I have logged the JSON response in the PHP side (Which is going to send to angular side as response) seems similar in both cases.

有关其他信息:在网络选项卡的标题部分,对于错误情况,没有响应头出现。因此,由于没有响应,因此它不会触发angularjs http post的then块,而是会触发error块。 并且在控制台选项卡中,该失败的请求url显示 net :: ERR_EMPTY_RESPONSE。

For additional information: In network tab, header section, there is no response header coming, for the error case. So its not triggering the then block of angularjs http post, instead its triggering the error block, as there is no response. And in console tab its showing "net::ERR_EMPTY_RESPONSE" for that failing request url.

有人对我为什么没有得到响应有任何想法吗?角边随机吗?

Does anyone have any idea about why am i not getting response in angular side randomly ?

推荐答案

找到了答案。 通过设置 Http动词-选项解决了我的问题。此外,禁用代理服务器也会有所帮助。

Found the answer. By setting Http verbs - options solved my issue. Also disabling the proxy server helps.

更多推荐

来自AngularJs中PHP的net :: ERR

本文发布于:2023-10-11 22:58:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483077.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PHP   AngularJs   ERR   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!