title: Flask : Decorator to test query string arguments
body: <p>I begin with Flask and try to create the best code possible. For some simple route, I would like to check if some required arguments are present.
  At this time, I create this decorator </p>
  
  <pre><code>def validate_qs_arguments(arguments):
      def decorator(fn):
          def wrapped_function(*args, **kwargs):
              for argument_name in arguments:
                  if request.args.get(argument_name) is None:
                      abort(400, "'{name}' argument is missing".format(name=argument_name))
              return fn(*args, **kwargs)
          return update_wrapper(wrapped_function, fn)
      return decorator
  </code></pre>
  
  <p>I can use it like this :</p>
  
  <pre><code>@validate_qs_arguments(arguments=["pid", "datastream"])
  </code></pre>
  
  <p>It works fine. But I'm trouble than Flask doesn't provide a build-in function/decorator to do the same thing.
  Is it exists a better to do that ? A build-in flask decorator/function ?</p>
  
  <p>Thanks for your help.</p>