1

im trying to get data from tilda.cc forms https://help.tilda.cc/formswebhook

thats my fastapi code

from fastapi import Request, FastAPI

@app.post("/request_from_tilda/")
async def root(request: Request):
    data = await request.json()
    print(data)
    return str(data) 

when i trying with postman - its works but tilda says:

[CODE: 500] webhook URL not available. HTTP/1.1 500 Internal Server Error date: Thu, 05 May 2022 09:07:45 GMT server: uvicorn content-length: 21 content-type: text/plain; charset=utf-8 Internal Server Error

with flask, its works

from flask import Flask
from flask import request

app = Flask(__name__)


@app.route('/request_from_tilda/', methods = ['POST'])
def result():
    r = dict(request.form)
    print(r)
    return r

How i can make the same post method with FastApi?

davidism
  • 121,510
  • 29
  • 395
  • 339
ilya
  • 19
  • 1

0 Answers0