Интерфейс Python flask не может связаться с серверной частью Python FastAPI [закрыто]Python

Программы на Python
Ответить
Anonymous
 Интерфейс Python flask не может связаться с серверной частью Python FastAPI [закрыто]

Сообщение Anonymous »

У меня есть интерфейс Python Flask, работающий на локальном хосте: 5000. Он не может выполнять вызовы API к моему серверу FastAPI Python, работающему на локальном хосте: 8001.Он выдает ошибку 403, и когда я проверил текст ответа, он отображается ниже html:

Код: Выделить всё

'\n\n\n\n\n\n\n  \n  Web Gateway - Notification - Uncategorized URL\n  \n  \n  [*]\n\n\n\n\n  \n    \n      \n\n\n  \n    \n        
[img]\[/img]
\n    \n  \n\n\n\n\n\n\n  \n    \nUncategorized URL\n    \n  \n\n\n\n\n\n  \n    \n\nThe website you are trying to access is currently uncategorized. Criminals often use these uncategorized sites to distribute malware. However, if you are positive this website is legitimate and safe, please confirm by clicking “Yes, this is a trusted website and I want to continue”[/b] below and you will be directed to the website.  If you do not think the site is safe and do not want to proceed, close the browser by clicking the “x” in the top right corner of the browser window.\n      [b]
\n    \n  \n\n\n\n\n\n\n\n\nUser: [/b]  ()[b]\nURL:[/b]\n\nbreak_line(\'http://localhost:8001/gcp_gemini/invoke\');\n\n(127.0.0.1)[b]\n\n\nURL Categories:[/b] \n[url=\]
[img]\[/img]
[/url]\n[b]\n\n\n\nmycompany Categories:[/b]  \n[b]\n\n\n\n\n\nReputation: [/b]Unverified  (15)\n
[img]\[/img]
\n[b]\n\n\n\n\nGeolocation:[/b] writeToDocument(countries[\'\'])\n
[img]\[/img]
\n\n    \n  \n\n\n\n\n\n\n[b]Please confirm: [/b]\n\n\n\n\n\n\n\n\n\n\n\n  \n    \n      For assistance, please contact mycompany SPOC 
\n    \n  \n  \n    \n      generated 2024-11-12 08:43:37  by winp-proxy-106[b]\n      TS-Database=130071
\n      python-requests/2.32.3
\n      Rules.CurrentRule.Name: Coaching for Uncategorized URLs (Coaching With URL Configuration)\n    \n  \n\n\n      \n    \n  \n\n\n\n'
В моей конфигурации интерфейса я заменил localhost на 127.0.0.1, затем получил ошибку 502, и она отображается ниже html:

Код: Выделить всё

'\n\n\n\n\n\n\n  \n  McAfee Web Gateway - Notification - \n  \n  \n  \n\n\n\n\n  \n    \n      \n\n\n  \n    \n        
[img]\[/img]
\n    \n  \n\n\n\n\n\n\n  \n    \n      Cannot Connect - Internal Web Server Error\n    \n  \n\n\n\n\n\n\n[list]\n        What Happened?\n[/list]\n\n        
The web server encountered an unexpected\ncondition \n        which prevented it from fulfilling the request from your\nbrowser.
\n\n[list]\n        How Did It Happen?\n[/list]\n\n        
You successfully reached the web server via the \n        network.  Something has gone wrong within the web server, but the \n        server can not be more specific about the error condition in its\nresponse \n        back to your browser. This is a "catch-all\' error generated by\nthe web \n        server.
\n        
In addition to the 500 error sent back to your \n        browser, the web server should generate some kind of internal error\nlog \n        which may provide the web server owner more details of what went\nwrong.\n        
\n\n[list]\n        What Does This Error Mean?\n[/list]\n\n        
Even though you were able to reach the web\nserver via \n        the network, for some unknown reason, the server is unable to service\nyour \n        browser\'s request.  The web server should have generated an error\non \n        the internal web server logs.  The web site owner need to\nresearch this \n        error and resolve it. 
\n\n[list]\n        How To Correct The Error!\n[/list]\n\n        [list]\n                        Check the URL to ensure you\nhave entered it \n                correctly.Contact the web site\nowner.[list]\n                                The web site owner may\nalready be aware of the problem.\n                                [*]If the web site owner\nis not aware of the problem, the 500 error should \n                produce entries in the web server log that may assist them\nwith \n                resolving this issue.  \n                        [/list]\n                        Contact the mycompany SPOC at\nphoneNumber for assistance.[/list]\n\n

\n\n\n\n\n  \n    \n      URL: [/b]break_line("http://127.0.0.1:8001/azure_openai/invoke");[b]\nBlock.ID:[/b] 0 \n    \n  \n\n\n\n\n\n\n\n  \n    \n      For assistance, please contact mycompany SPOC phoneNumber\n    \n  \n  \n    \n      generated 2024-11-25 08:45:44 by someproxyID
\n      TS-Database=someNumber
\n      python-requests/2.32.3
\n      Rules.CurrentRule.Name: Anti-Malware: Scan Completed (Anti-Malware)\n    \n  \n\n\n      \n    \n  \n\n\n\n'
может ли кто-нибудь помочь мне решить эту проблему?

Подробнее здесь: https://stackoverflow.com/questions/792 ... pi-backend
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»