The POST methods on REST are used for resource creation, not that this isn't considered an idempotent method. Using our new knowledge of the Flask Restful parser, we can cover the POST endpoint. First, we will need a parser that will take a title, the body text, and a list of tags. In the parser.py file, find the following:
post_post_parser = reqparse.RequestParser()
post_post_parser.add_argument(
'title',
type=str,
required=True,
help="Title is required",
location=('json', 'values')
)
post_post_parser.add_argument(
'text',
type=str,
required=True,
help="Body text is required",
location=('json', 'values')
)
post_post_parser.add_argument(
'tags',
type=str,
action='append',
location=('json', 'values')
)
Next...