Redirection

Batman wanted to redirect some endpoints to others. Robyn helped him do so by the following:

Request

from robyn import Robyn, Response
app = Robyn(__file__)

@app.get("/")
async def index():
  return Response(
    status_code=307,
    description="",
    headers={"Location": "landing"},
  )

@app.get("/landing")
def landing():
  return "hii!"

What's next?

Now, Batman wanted to have the ability to upload files to the server if any new villain appeared. Robyn introduced him to the file upload and some of the form data features.