i am new to python asyncio . i want to read and data from a post request .
when data is in large amount , 

My  code is receiving an empty data from reader.read() function

please suggest me some way to read bulk data in one shot.

def handle_connection(reader, writer):
        data = ""
        while True:
            data_loc =  yield from  reader.readexactly(8192)
            print(data_loc) ### here it is receiving an empty data from 
client in case of bulk data sent through post parameter
            if not data_loc:
                break
            data += data_loc.decode('utf-8')
            
        if data:
            #message =  data.decode('utf-8')
            print(data)
            yield from process_payload(writer, message, 30)
            
        writer.write_eof()   
        writer.close()


url = 'not.real.ip.address'
data = {'symbols': 
'GD-US,14174T10,04523Y10,88739910,03209R10,46071F10,77543110,92847N10'}

loop = asyncio.get_event_loop()
loop.run_until_complete(echo_server())
try:
    loop.run_forever()
finally:
    loop.close()
    


Reply via email to