mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Add xml endpoint
This commit is contained in:
committed by
Kevin McCarthy
parent
b2cb8678f3
commit
64d10cba0e
+7
-1
@@ -45,7 +45,6 @@ tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
|
||||
|
||||
app = Flask(__name__, template_folder=tmpl_dir)
|
||||
|
||||
|
||||
# -----------
|
||||
# Middlewares
|
||||
# -----------
|
||||
@@ -535,5 +534,12 @@ def image():
|
||||
return status_code(404)
|
||||
|
||||
|
||||
@app.route("/xml")
|
||||
def xml():
|
||||
response = make_response(render_template("sample.xml"))
|
||||
response.headers["Content-Type"] = "application/xml"
|
||||
return response
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user