main.py 700 B

12345678910111213141516171819202122232425262728293031323334353637
  1. from fastapi import FastAPI
  2. import sys
  3. import os
  4. import requests
  5. from fastapi import FastAPI,Form, Request,UploadFile
  6. import uvicorn
  7. from pydantic import BaseModel
  8. from fastapi import Request, FastAPI
  9. app = FastAPI()
  10. #@app.post("/postform1")
  11. #def postform1(username: str = Form(...)):
  12. # print (username)
  13. # return username
  14. class q_req(BaseModel):
  15. domain_name: str
  16. @app.post("/postform1")
  17. async def postform1(request: Request):
  18. js= await request.json()
  19. print(js)
  20. print(str(js))
  21. return js
  22. # return await request.json()
  23. @app.get("/")
  24. async def root():
  25. return {"message": "test"}
  26. if __name__ == "__main__":
  27. uvicorn.run("main:app", host="0.0.0.0", port=8383)