Flask broken pipe with requests

后端 未结 4 906
无人共我
无人共我 2020-11-28 05:15

I\'d like to send a local REST request in a flask app, like this:

from flask import Flask, url_for, request
import requests

app = Flask(__name__)

@app.rout         


        
4条回答
  •  悲&欢浪女
    2020-11-28 05:55

    I have had the same issue with post method, in general my post method was doing nothing, thats why this issues came

    return _socket.socket.send(self._sock, data, flags) urllib3.exceptions.ProtocolError:
    ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
    
    if request.method == 'POST':
        print(len(request.data))
    return 'dummy'
    

    this print did the trick

提交回复
热议问题