def delete_post_response(dom, request):
id_text = dom.find('Body/DeletePost/id').text
post = MemoryDb.get_post(id_text, get_ip(request))
if not post:
raise exception_response(404)
if MemoryDb.is_post_read_only(post.id):
raise exception_response(403)
MemoryDb.delete_post(post, get_ip(request))
resp_xml = """<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<DeletePostResponse xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>"""
return Response(body=resp_xml, content_type='text/xml')
blog_soap.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录