コード例 #1
0
ファイル: beta.py プロジェクト: MujiP/DarkThunder
 def on_get(self, req: falcon.Request, resp: falcon.Response):
     resp.status = falcon.HTTP_302
     resp.content_type = 'text'
     beta_link = r'https://testflight.apple.com/join/e05hgsxP?fbclid=IwAR2Trl0qZ9pFvEaKjQq2aVvAwJC8IwjPUaEGrJJWls1HiER2MgjE-wCw0MM'
     resp.location = beta_link
     resp.body = r'Please follow this link to access the beta: {}'.format(
         beta_link)
コード例 #2
0
ファイル: endpoints.py プロジェクト: stevepentland/swarmer
 def on_post(self, req: falcon.Request, resp: falcon.Response):
     logger.info('Received request to create new job')
     image_name = req.media.get('image_name')
     callback = req.media.get('callback_url')
     tasks = req.media.get('tasks')
     # tasks = req.media.get('tasks')
     identifier = self._runner.create_new_job(image_name, callback, tasks)
     logger.info('Job created with identifier {i}'.format(i=identifier))
     resp.status = falcon.HTTP_201
     resp.media = {'id': identifier}
     resp.location = '/status/{i}'.format(i=identifier)
コード例 #3
0
 def on_post(self, req: Request, resp: Response) -> None:
     bibliography_entry = req.media
     self._bibliography.create(bibliography_entry, req.context.user)
     resp.status = falcon.HTTP_CREATED
     resp.location = f'/bibliography/{bibliography_entry["id"]}'
     resp.media = bibliography_entry