2020-08-27 10:07:46 +03:00
|
|
|
# coding=utf-8
|
|
|
|
from flask import request
|
2022-02-14 11:13:33 +03:00
|
|
|
from app import app
|
2020-08-27 10:07:46 +03:00
|
|
|
|
2022-02-05 08:56:33 +03:00
|
|
|
|
|
|
|
@app.route("/post-xml", methods=["POST"])
|
2020-08-27 10:07:46 +03:00
|
|
|
def post_xml():
|
|
|
|
s = request.data.decode("utf-8")
|
2022-02-05 08:56:33 +03:00
|
|
|
assert (
|
|
|
|
s
|
|
|
|
== """<?xml version="1.0"?>
|
|
|
|
<drink>caf\u00e9</drink>"""
|
|
|
|
)
|
|
|
|
return ""
|
|
|
|
|
2020-08-27 10:07:46 +03:00
|
|
|
|
2022-02-05 08:56:33 +03:00
|
|
|
@app.route("/post-xml-no-prolog", methods=["POST"])
|
2020-08-27 10:07:46 +03:00
|
|
|
def post_xml_no_prolog():
|
|
|
|
s = request.data.decode("utf-8")
|
2022-02-05 08:56:33 +03:00
|
|
|
assert s == """<drink>caf\u00e9</drink>"""
|
|
|
|
return ""
|