Currently, I am delving into the world of web APIs and have stumbled upon a perplexing issue that requires assistance.
I have an active ASP.NET Core Web API at the backend, while at the frontend, an Angular application (running on version 15.1.5) is in play. Upon making a GET request to one of my API endpoints with a customized header using Postman, I receive the expected response body back alongside the header itself. However, when replicating the same request from my Angular application, the response body comes back empty. Ideally, I would like the header passed in Postman to be visible on my frontend as well.
What steps can I take to troubleshoot this puzzling situation?
The Postman call details are also attached for reference.
Despite numerous attempts at troubleshooting, I find myself facing an unresolved dilemma. My focus lies on building an Angular application that interacts with an ASP.NET Core Web API. A pressing issue arises when calling one of my API endpoints through my Angular application; the response body appears empty despite successful execution of the code beneath.
As part of my investigation into the matter, I have utilized console.log
statements within my codebase and ensured smooth operation until the point of the actual request. Nevertheless, the response body persists in its emptiness.
This endeavor prompts me to question whether parameters passed through Postman should be visible on the frontend of my application. Additionally, I observe an empty string displayed on Swagger UI, hinting at a possible correlation with my existing issue.
How may I tackle this conundrum effectively?