前言
在校验请求参数的时候,除了一些基本的required=True, type类型外,还会遇到一些校验,比如是否为空,字符串长度,以及一些自定义的参数规则。
add_argument 参数
class Argument(object):
"""
:param name: Either a name or a list of option strings, e.g. foo or -f, --foo.
:param default: The value produced if the argument is absent from the request.
:param dest: The name of the attribute to be added to the object
returned by :meth:`~reqparse.RequestParser.parse_args()`.
:param bool required: Whether or not the argument may be omitted (optionals only).
:param string action: The basic type of action to be taken when this argument
is encountered in the request. Valid options a