Postman not working on Ember with back-end JSON AP

2019-09-25 16:04发布

问题:

I am new to Ember and have posted a similar post regarding troubleshooting of a simple Ember front-end with JSON API web back-end (see below). My problem here is that I am unable to get Postman to display any data in the DevTools console - its blank. I can use Postman to submit requests and see the response in the body, that is all.

I have tried various permutations of using the application while going so far as to uninstall and re-install. But, nothing is working. Is anyone aware of the steps necessary to use Postman to troubleshoot problems?

Ember 3.2.2 not routing request to .NET Core 2.1 JSON web API

回答1:

As figured out in comments you were messing up Postman with developer tools of browser.

While Postman is great to debug and test REST APIs, it can't be used to inspect single page applications (SPA) running in browser window. Postman is it's own application and does not interfere with your ember.js web application which is running another task.

To inspect a single page application (or other websites) the developer tools which are provided by all major browsers are very helpfull. These ones are shown in the video you have mentioned in comments. They have a network tab listing all requests fired. Here you find a detailed description of Google Chrome's network tab in developer tools. The other browsers share most of the features.

So to put it together: To investigate what network requests are fired by your single page application (e.g. ember.js) use the network tab of browser's developer tools. If you need to investigate your API behavior more in detail (e.g. to see why a network request of your SPA fails), Postman is a great tool to do this.