12345678910111213141516171819202122232425262728293031323334353637 |
- from fastapi import FastAPI
- import sys
- import os
- import requests
- from fastapi import FastAPI,Form, Request,UploadFile
- import uvicorn
- from pydantic import BaseModel
- from fastapi import Request, FastAPI
- app = FastAPI()
- #@app.post("/postform1")
- #def postform1(username: str = Form(...)):
- # print (username)
- # return username
- class q_req(BaseModel):
- domain_name: str
- @app.post("/postform1")
- async def postform1(request: Request):
- js= await request.json()
- print(js)
- print(str(js))
- return js
- # return await request.json()
- @app.get("/")
- async def root():
- return {"message": "test"}
- if __name__ == "__main__":
- uvicorn.run("main:app", host="0.0.0.0", port=8383)
|