Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

fastapi json request

from fastapi import FastAPI, Request
my_app = FastAPI()

@my_app.post("/getInformation")
async def getInformation(info : Request):
    req_info = await info.json()
    return {
        "status" : "SUCCESS",
        "data" : req_info
    }
Source by codehandbook.org #
 
PREVIOUS NEXT
Tagged: #fastapi #json #request
ADD COMMENT
Topic
Name
3+5 =