You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Serverless, I'm deploying a FastAPI app to Lambda. The FastAPI app simply mounts a Flask app with a single POST route. When I try to access the request data, it's empty (b'') instead of what was submitted.
from fastapi import FastAPI
from flask import Flask, request
from mangum import Mangum
from starlette.middleware.wsgi import WSGIMiddleware
flask_app = Flask(__name__)
@flask_app.route("/", methods=["POST"])
def hello_world():
print(request.data)
return "Hello, World!"
fastapi_app = FastAPI(debug=True)
fastapi_app.mount("/", WSGIMiddleware(flask_app))
handler = Mangum(fastapi_app)
Using Serverless, I'm deploying a FastAPI app to Lambda. The FastAPI app simply mounts a Flask app with a single POST route. When I try to access the request data, it's empty (
b''
) instead of what was submitted.If I run this code via uvicorn, the request body is correct.
The text was updated successfully, but these errors were encountered: