mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
media()
This commit is contained in:
@@ -112,8 +112,8 @@ Here, we'll process our data in the background, while responding immediately to
|
||||
|
||||
|
||||
# Parse the incoming data as form-encoded.
|
||||
# Note: 'json' and 'yaml' formats are also supported.
|
||||
data = await resp.media('form')
|
||||
# Note: 'json' and 'yaml' formats are also automatically supported.
|
||||
data = await resp.media()
|
||||
|
||||
# Process the data (in the background).
|
||||
process_data(data)
|
||||
|
||||
@@ -191,6 +191,7 @@ class Request:
|
||||
|
||||
if format is None:
|
||||
format = "yaml" if "yaml" in self.mimetype or "" else "json"
|
||||
format = "form" if "form" in self.mimetype or "" else format
|
||||
|
||||
if format in self.formats:
|
||||
return self.formats[format](self)
|
||||
|
||||
Reference in New Issue
Block a user