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!