0
我遇到了需要在瓶子应用程序内部针对相同瓶子应用程序发出HTTP请求的问题。瓶子应用程序的递归调用使得线程块
@app.route('/endpoint1')
def endpoint1():
requests.get('http://localhost:5000/endpoint2')
...
@app.route('/endpoint2')
def endpoint2():
...
服务器被阻塞。
更好的设计是直接调用endpoint2,不需要像这样发出内部请求,或者根本不需要在flask中使用请求库。 –