1. Code directly
import uvicorn from fastapi import FastAPI from pydantic import BaseModel class
Item(BaseModel): a: int = None b: int = None app = FastAPI() @app.get("/") async
def get_info(): ''' It's a simple one get request :return: Direct return data ''' data = { "username":
"test", "password": "admin123" } return data @app.get("/post_info2") async def
post_info2(a: int,b:int): ''' An algorithm with parameters get request :param a: :param b: :return: a + b
''' c = a + b result = {'a': a, 'b': b, 'a+b': c} return result @app.post(
"/post_info1") async def post_info1(request_data: Item): ''' Must pass json Of post Interface
:param request_data: json field (Item class ) :return: return a+b The sum of ''' a = request_data.a b =
request_data.b c = a + b result = {'a': a, 'b': b, 'a+b': c} return result if
__name__== '__main__': uvicorn.run(app=app, host='', port=8000)
2. Request process

3. Request results

©2020 ioDraw All rights reserved
0.96OLED display -4 Line SPI explain C++11 of std::function,std::bind,std::placeholdersJavaScript study ( Function declaration and parameters )QTabWidget Style sheet settings The project passed idea Package and publish to tomcat The server postman Interface test get timestamp and MD5 encryption react Background management configuration route and sidebar :python Simple game code -10 Minutes Python Write a snake game , simple You know? Python What does the foundation include ? Learn something ?10 individual Python Introduction to crawler