I am consuming a set of API for my screen. While the api are working fine when i am testing them using Postman. Also its showinng the desired output in outsystems but on the UI front it is showing error 404. Can anyone please help
Scrrenshot of UI-
Screenshot of consuming the api and testing which shows the output is being received
Hi Saif,
A 404 can mean two things: either the URL you have configured doesn't exist at all, or the resource you are trying to access doesn't exist. In the first case it's the web server "at the door" of the host that returns the error as it can't find the end point, in the second case it's a valid URL but the application running on the other side can't find the resource you specified.
Regardless, you haven't provided enough information for us to be able to see what's wrong. What you need to check:
I hope you're doing well.
Regarding this issue, you can customize your response on the "OnAfterResponse" - Use to modify the information of the original response, such as the status code or the response text.
Please see these OutSystems documentation:
I hope that helps you.
Let me know if this solves your issue.
Kind regards,
FC
I am confused but what you proposed, it doesn't read like an answer to the question.
The way I read the question, the API call works from Postman or when testing the API in Service Studio, but when done in OutSystems it doesn't.
So it is about exploring why he gets a 404, not changing the message returned.
@saif sheikh am I correct in what I think you are asking?
I understood that the API is working in Postman and it's working in OutSystems, but when he tries to show the results on the UI receive the error 404.
Error 404 - Not Found - The specified REST API or method doesn't exist.
So I suggested @saif sheikh change the status code to see what's happening.
Maybe can be the same issue as this.
Yes, you suggested it, but it's bad advise. He should first check what the source of the 404 is, changing the status code by an On After Response is really the last resort, once you know what is wrong.