mirror of
https://github.com/Kozea/Radicale.git
synced 2025-07-02 16:58:30 +00:00
Extract read*_request_body methods
This commit is contained in:
parent
42ad18bc84
commit
0ce90d6b34
10 changed files with 63 additions and 51 deletions
|
@ -21,7 +21,7 @@ Custom web plugin.
|
|||
|
||||
from http import client
|
||||
|
||||
from radicale import web
|
||||
from radicale import httputils, web
|
||||
|
||||
|
||||
class Web(web.BaseWeb):
|
||||
|
@ -29,5 +29,5 @@ class Web(web.BaseWeb):
|
|||
return client.OK, {"Content-Type": "text/plain"}, "custom"
|
||||
|
||||
def post(self, environ, base_prefix, path, user):
|
||||
answer = "echo:" + environ["wsgi.input"].read().decode()
|
||||
return client.OK, {"Content-Type": "text/plain"}, answer
|
||||
content = httputils.read_request_body(self.configuration, environ)
|
||||
return client.OK, {"Content-Type": "text/plain"}, "echo:" + content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue