backend/api.py
def on_post(self, req, resp):
        """Creates a new article using POST"""
        req_body = json.loads(req.stream.read().decode('utf-8'))
        title = req_body['title']
        subtitle = req_body['subtitle']
        body = req_body['body']
        blog.create_article(title, subtitle, body)
        resp.status = falcon.HTTP_200
Creates a new article using POST
Creates a new article using POST
Creates a new article using POST
def on_post(self, req, resp):
        req_body = json.loads(req.stream.read().decode('utf-8'))
        title = req_body['title']
        subtitle = req_body['subtitle']
        body = req_body['body']
        blog.create_article(title, subtitle, body)
        resp.status = falcon.HTTP_200
def on_post ( self , req , resp ) : req_body = json . loads ( req . stream . read ( ) . decode ( 'utf-8' ) ) title = req_body [ 'title' ] subtitle = req_body [ 'subtitle' ] body = req_body [ 'body' ] blog . create_article ( title , subtitle , body ) resp . status = falcon . HTTP_200
Creates a new article using POST
Creates a new article using POST
"""Creates a new article using POST"""
self
req
resp