Flask “如何修复”;无法得到任何响应“?”;?

Flask “如何修复”;无法得到任何响应“?”;?,flask,postman,Flask,Postman,我试图在postman或google chrome上调用我的api flask,我总是得到以下信息: 邮递员: Could not get any response There was an error connecting to 192.168.1.178:5000/. Why this might have happened: The server couldn't send a response: Ensure that the backend is working properly Se

我试图在postman或google chrome上调用我的api flask,我总是得到以下信息:
邮递员:

Could not get any response
There was an error connecting to 192.168.1.178:5000/.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General

谷歌浏览器

Ce site est inaccessible
192.168.1.178 a mis trop de temps à répondre.

这看起来像是flask服务器的问题,或者可能与身份验证方法或请求中缺少的数据有关

您可以做的是使用调试发送到服务器的请求。 您可以寻找的是:

  • 检查请求的URL(在您的情况下,我认为它是一个IP地址)
  • 检查请求方法,例如“GET”、“POST”-您可能使用错误的方法调用请求
  • 检查身份验证方法和凭据
  • 检查请求正文和标题
  • 等等。。确保您满足了完整请求的所有要求

您还可以在flask服务器中放入
print
语句,查看是否正在调用端点(如果是本地服务器)。

我检查了所有这些,但问题是当我放入“print”时,我注意到端点没有被调用called@LOF可能您的端点设置不正确?在这种情况下,您需要调试服务器。检查路由等。检查函数名称的拼写等。但无论如何,服务器应该抛出404。postman中的此错误表示您的服务器不可用。您是否需要某种代理等来处理此问题?