邮递员无法使用后端JSON API在Ember上工作 [英] Postman not working on Ember with back-end JSON API

查看:112
本文介绍了邮递员无法使用后端JSON API在Ember上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ember的新手,并且发布了类似的文章,内容涉及使用JSON API Web后端对简单的Ember前端进行故障排除(请参阅下文)。我的问题是我无法让Postman在DevTools控制台中显示任何数据-空白。我可以使用Postman提交请求,并在正文中看到响应,仅此而已。

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.

我尝试了各种应用程序排列,甚至可以卸载并重新安装。但是,没有任何效果。是否有人知道使用Postman解决问题的必要步骤?

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无法将请求路由到.NET Core 2.1 JSON Web API

推荐答案

正如注释中所指出的,您搞砸了邮递员浏览器开发人员工具 >。

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

虽然Postman非常适合调试和测试REST API,但不能用于检查在浏览器窗口中运行的单页应用程序(SPA)。邮递员是它自己的应用程序,不会干扰运行另一个任务的ember.js Web应用程序。

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.

要检查开发人员的单页应用程序(或其他网站)所有主要浏览器提供的工具都非常有用。这些已显示在您在评论中提到的视频中。他们有一个网络标签列出了所有触发的请求。 此处,您会找到有关Google Chrome浏览器网络的详细说明开发人员工具中的标签。其他浏览器共享大多数功能。

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.

因此,将它们放在一起:要调查您的单页应用程序(例如ember.js)触发了哪些网络请求,请使用浏览器开发人员工具的网络标签。如果您需要更详细地调查您的API行为(例如,查看SPA的网络请求失败的原因),Postman是一个很好的工具。

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.

这篇关于邮递员无法使用后端JSON API在Ember上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆