class FormDataParser: (source)
This class implements parsing of form data for Werkzeug. By itself it can parse multipart and url encoded form data. It can be subclassed and extended but for most mimetypes it is a better idea to use the untouched stream and expose it as separate attributes on a request object. .. versionadded:: 0.8 :param stream_factory: An optional callable that returns a new read and writeable file descriptor. This callable works the same as :meth:`Response._get_file_stream`. :param charset: The character set for URL and url encoded form data. :param errors: The encoding error behavior. :param max_form_memory_size: the maximum number of bytes to be accepted for in-memory stored form data. If the data exceeds the value specified an :exc:`~exceptions.RequestEntityTooLarge` exception is raised. :param max_content_length: If this is provided and the transmitted data is longer than this value an :exc:`~exceptions.RequestEntityTooLarge` exception is raised. :param cls: an optional dict class to use. If this is not specified or `None` the default :class:`MultiDict` is used. :param silent: If set to False parsing errors will not be caught. :param max_form_parts: The maximum number of parts to be parsed. If this is exceeded, a :exc:`~exceptions.RequestEntityTooLarge` exception is raised.
Method | __init__ |
Undocumented |
Method | get |
Undocumented |
Method | parse |
Parses the information from the given stream, mimetype, content length and mimetype parameters. |
Method | parse |
Parses the information from the environment as form data. |
Class Variable | parse |
Undocumented |
Instance Variable | charset |
Undocumented |
Instance Variable | cls |
Undocumented |
Instance Variable | errors |
Undocumented |
Instance Variable | max |
Undocumented |
Instance Variable | max |
Undocumented |
Instance Variable | max |
Undocumented |
Instance Variable | silent |
Undocumented |
Instance Variable | stream |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
t.Optional[ TStreamFactory]
= None, charset: str
= 'utf-8', errors: str
= 'replace', max_form_memory_size: t.Optional[ int]
= None, max_content_length: t.Optional[ int]
= None, cls: t.Optional[ t.Type[ MultiDict]]
= None, silent: bool
= True, *, max_form_parts: t.Optional[ int]
= None):
(source)
¶
Undocumented
str
, options: t.Dict[ str, str]
) -> t.Optional[ t.Callable[ [ FormDataParser, t.IO[ bytes], str, t.Optional[ int], t.Dict[ str, str]], t_parse_result]]
:
(source)
¶
Undocumented
t.IO[ bytes]
, mimetype: str
, content_length: t.Optional[ int]
, options: t.Optional[ t.Dict[ str, str]]
= None) -> t_parse_result
:
(source)
¶
Parses the information from the given stream, mimetype, content length and mimetype parameters. :param stream: an input stream :param mimetype: the mimetype of the data :param content_length: the content length of the incoming data :param options: optional mimetype parameters (used for the multipart boundary for instance) :return: A tuple in the form ``(stream, form, files)``.
Parses the information from the environment as form data. :param environ: the WSGI environment to be used for parsing. :return: A tuple in the form ``(stream, form, files)``.
t.Dict[ str, t.Callable[ [ FormDataParser, t.IO[ bytes], str, t.Optional[ int], t.Dict[ str, str]], t_parse_result]]
=
(source)
¶
Undocumented
def _parse_multipart(self, stream:
t.IO[ bytes]
, mimetype: str
, content_length: t.Optional[ int]
, options: t.Dict[ str, str]
) -> t_parse_result
:
(source)
¶
Undocumented
def _parse_urlencoded(self, stream:
t.IO[ bytes]
, mimetype: str
, content_length: t.Optional[ int]
, options: t.Dict[ str, str]
) -> t_parse_result
:
(source)
¶
Undocumented