Skip to content

Instantly share code, notes, and snippets.

@aoirint
Last active July 11, 2022 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aoirint/870950ab3834b5d4e9aa27c82e1c4e43 to your computer and use it in GitHub Desktop.
Save aoirint/870950ab3834b5d4e9aa27c82e1c4e43 to your computer and use it in GitHub Desktop.
# fastapi==0.78.0
from fastapi import FastAPI, Request
app = FastAPI()
@app.post('/')
async def index(request: Request):
print(request.headers)
print((await request.body()).decode('utf-8'))
@aoirint
Copy link
Author

aoirint commented Jul 11, 2022

pip3 install uvicorn fastapi

uvicorn dumphttppostreq:app

ngrok http 8000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment