Last active
August 29, 2020 09:18
-
-
Save jamescalam/60e8b80cf6b7db6ee3cf8c455c310275 to your computer and use it in GitHub Desktop.
Example script for using reqparser to extract arguments given in API request.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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