Add flasktools.atom_response.
This commit is contained in:
parent
a06f51c49c
commit
1b7b506e20
1 changed files with 5 additions and 0 deletions
|
@ -299,6 +299,11 @@ def gzip_response(request, response):
|
|||
|
||||
return response
|
||||
|
||||
def atom_response(soup, *args, **kwargs):
|
||||
response = flask.Response(str(soup), *args, **kwargs)
|
||||
response.headers['Content-Type'] = 'application/atom+xml;charset=utf-8',
|
||||
return response
|
||||
|
||||
def json_response(j, *args, **kwargs):
|
||||
dumped = json.dumps(j)
|
||||
response = flask.Response(dumped, *args, **kwargs)
|
||||
|
|
Loading…
Reference in a new issue