Django的:是否有任何工具/技巧,在调试Ajax响应使用?有任何、技巧、工具、Django

2023-09-10 16:41:25 作者:其实很在乎°

通常情况下,当我得到500内部服务器错误,从一个Ajax调用,我没有能看到响应的细节(因为你不想向他们展示给用户)。而在服务器端,我只看到这样一行GET / XXX / YYY / HTTP / 1.1500 1150336

在不修改我的客户端code(即HTML / JS),除非该变化是最小的,一劳永逸的一切,都是有任何方便的工具或技巧,我可以用它来看到的细节AJAX响应(无论是从客户机侧或服务器侧或两者)?

使用数据包捕获程序,如Wireshark是不是一种选择这里,因为它不简化与我的调试过程,因此不得心应手。

请注意,无论是客户端和服务器都从同一台机器上运行了。

感谢。

解决方案 在打开调试模式 火了镀铬 一键CMD +选项+ J(开放式开发工具) 转到网络标签 点击在Ajax请求 点击在preVIEW或响应标签

真棒!我刚刚意识到Chrome浏览器实现的响应的渲染的为好。

Usually, when I get 500 Internal Server Error from an ajax call, I don't get to see the details of the response (because you don't want to show them to users). And on the server side, I see only a line like "GET /xxx/yyy/ HTTP/1.1" 500 1150336.

django中ajax应用

Without modifying my client-end code (ie. html/js), unless the change is minimal and once-for-all, are there any handy tools or tricks that I can use to see the details of the AJAX response (either from the client side or the server side or both)?

Using packet-capturing programs like WireShark isn't an option here, as it is not streamlined with my debugging process and thus not handy.

Note that both the client-end and the server are running off from the same machine.

Thanks.

解决方案

Turn on debug mode Fire up chrome Push cmd+option+j (open dev tools) Go to the network tab Click on the ajax request Click on the preview or response tab

Awesome! I just realized Chrome implemented rendering of the response as well.