Problem description
The interface is newly developed and not online, so I brought the branch of the back-end project in the test environment, but found 404 error when the test environment called the back-end interface, as shown in the figure:
Thinking process
- First of all, the first reaction is that the URL is written wrong, such as the word is written wrong, more “/” and so on, but re-go to the interface document copy found that there is no wrong.
- Then, suspecting that there was no back-end interface resource, I opened the interface directly in the browser and found that the GET request was available. And after inquiry, the interface has been verified by ios and Android is feasible. I did my own postman request and found it worked (no parameter, but with backend resources).
- Then I suspect that the POST in the browser is being proxied to another environment. Turn off Charles and switchyOmega to check if any of my projects are being proxied by middleware, but it is not. This is interesting, and I suddenly thought I might learn something from this question.
- A closer look at 404’s return value looks like this:
conclusion
404 is not necessarily a pure front-end problem. When there is no possibility of error at the front end, new answers may be found by looking beyond the front end.