Skip to content

Instantly share code, notes, and snippets.

@jamescalam
Last active August 29, 2020 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamescalam/60e8b80cf6b7db6ee3cf8c455c310275 to your computer and use it in GitHub Desktop.
Save jamescalam/60e8b80cf6b7db6ee3cf8c455c310275 to your computer and use it in GitHub Desktop.
Example script for using reqparser to extract arguments given in API request.
parser = reqparse.RequestParser() # initialize
parser.add_argument('userId', required=True) # add arguments
parser.add_argument('name', required=True)
parser.add_argument('city', required=True)
args = parser.parse_args() # parse arguments to dictionary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment