denees_k

endpoint returns encoded link

Jul 6th, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # FastAPPI endpoint
  2. @router.get('/link/{link}',
  3.             description='Getting a not encoded link and return encoded',
  4.             summary="return encoded link",
  5.             response_description="json: encoded_link"
  6.             )
  7. async def film_details(link: str) -> JSONResponse:
  8.     encoded = base64.b64encode(link)
  9.     resp = json({'encoded_string': encoded})
  10.     return JSONResponse(content=resp)
  11.  
Add Comment
Please, Sign In to add comment