Search
 
SCRIPT & CODE EXAMPLE
 

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
    }
Comment

fastapi post example

from fastapi import FastAPI

import uvicorn

from pydantic import BaseModel     #<----- ทำการ import BaseModel เข้ามา


app = FastAPI()
Comment

PREVIOUS NEXT
Code Example
Python :: how to run bash script in python 
Python :: date colomn to datetime 
Python :: python convert a string to a list of words 
Python :: returns the smallest positive integer python 
Python :: how to import include in django 
Python :: code to calculate dice score 
Python :: pandas df make set index column 
Python :: install python in centos7 
Python :: list comprehension if else 
Python :: instabot login python 
Python :: python sorted dictionary multiple keys 
Python :: create exe from python script 
Python :: pyspark split dataframe by rows 
Python :: python series get value 
Python :: get time python 
Python :: how to open an image in opencv 
Python :: python check if number is in range 
Python :: keras callbacks learning rate scheduler 
Python :: how to plotting bar on matplotlib 
Python :: python get stock prices 
Python :: matlab to python 
Python :: urllib urlretrieve python 3 
Python :: how to close opencv window in python 
Python :: list with numbers between 2 values by 
Python :: override python print for class 
Python :: f string in python 
Python :: make screen shot of specific part of screen python 
Python :: how to press enter in selenium python 
Python :: replace string if it contains a substring pandas 
Python :: check if a the time is 24 hours older python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =