RomanKaiser

URL percent-encoding endpoint

Jan 9th, 2023
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. from fastapi import FastAPI
  2. from urllib import parse
  3.  
  4.  
  5. app = FastAPI()
  6.  
  7.  
  8. @app.get("/url_encoder")
  9. async def encode_url(url: str = ""):
  10.     return parse.quote(url)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment