问题
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.
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.
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.
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.
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 ?
回答1:
Found the answer.
By setting Http verbs - options
solved my issue. Also disabling the proxy server helps.
来源:https://stackoverflow.com/questions/56767148/neterr-empty-response-from-php-in-angularjs