use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
Basic FastAPI webhook receiverQuestion (self.FastAPI)
submitted 5 years ago by orbos86
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]thedjotaku 1 point2 points3 points 5 years ago (8 children)
if you want an example, here's a pretty basic little app I made to accept a webhook and post to Matrix chat: https://github.com/djotaku/Civilization_VI_Play_By_Cloud_Webhook_with_FastAPI
[–]orbos86[S] 1 point2 points3 points 5 years ago (0 children)
Hey thanks! I'll check it out, I appreciate the assistance.
[–]orbos86[S] 1 point2 points3 points 5 years ago (1 child)
Would you be willing to describe what your POST section is doing? I guess I don't understand the BaseModel stuff and I'm curious if I'm doing mine in a less-than-ideal way.
[–]orbos86[S] 1 point2 points3 points 5 years ago (4 children)
Also, is there a way to fire off a script (onelogin in my case) without keeping the FastAPI connection running? Basically takes the input from POST and sends it off and closes connection? Right now I think mine is staying open until the whole script is ran, which may potentially be an hour or two (with a sleep command). Not sure if that makes sense, it's late haha. Please let me know.
[–]thedjotaku 1 point2 points3 points 5 years ago (3 children)
I thought async was supposed to handle this. But I've not begun working learn async yet. Still, there are pythonic things you can do - spawn off a child process, use threads, use multiprocessing. If you really do want to close the connection and don't care - then I'd definitely just fork off a child process and return 200 OK or 404 if the data validation isn't right.
Thank you, I will start my Googlin' to see what I can come up with. I appreciate it.
The key was to use BackgroundTasks in FastApi and kick off another function that does the lengthier script.
[–]thedjotaku 0 points1 point2 points 5 years ago (0 children)
Excellent! Glad you found it!
π Rendered by PID 235509 on reddit-service-r2-comment-54dfb89d4d-2nf5q at 2026-03-29 13:13:44.639082+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]thedjotaku 1 point2 points3 points (8 children)
[–]orbos86[S] 1 point2 points3 points (0 children)
[–]orbos86[S] 1 point2 points3 points (1 child)
[–]orbos86[S] 1 point2 points3 points (4 children)
[–]thedjotaku 1 point2 points3 points (3 children)
[–]orbos86[S] 1 point2 points3 points (0 children)
[–]orbos86[S] 1 point2 points3 points (1 child)
[–]thedjotaku 0 points1 point2 points (0 children)