Python3 WeChat Pay asynchronously notifies django

ask for help! WeChat Pay callback of django, there is a problem receiving asynchronous notifications.

Code first:

    -sharp
    def weChatQRCodeNotify(request):
        order_result_xml = http.request.httprequest.stream.read() -sharp
        doc = xmltodict.parse(order_result_xml) -sharpxmldict
        out_trade_no = doc["xml"]["out_trade_no"] -sharp
        -sharptodo:
        -sharp:
        -sharp
        return """
            <xml>
            <return_code><![CDATA[SUCCESS]]></return_code>
            <return_msg><![CDATA[OK]]></return_msg>
            </xml>
            """

now the problem has been locked. The first line of code
order_result_xml = http.request.httprequest.stream.read ()-sharp extracts data from the request stream
prompts http without request attribute under python3. If you directly let order_result_xml equal to the string < xml >. < / xml > , it is successful.

so what method can python3 use instead of http.request.httprequest.stream.read () ? Or what method can directly obtain the xml data from POST.

Thank you!


because it is a POST request, the xml content is in the body of the request, so you can get the xml data directly through request.body, but it is a string, so you just need to convert it into a dictionary.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36578-2c00c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36578-2c00c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?