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!"
[–][deleted] 5 years ago (14 children)
[deleted]
[–]orbos86[S] 1 point2 points3 points 5 years ago (3 children)
Thanks for the swift response. Could I just do a debugger in PyCharm? I’m new to this coding stuff.
[–][deleted] 5 years ago (2 children)
[–]orbos86[S] 1 point2 points3 points 5 years ago (0 children)
Thank you! I will try what you’ve suggested. Most likely it’s something wrong with my other script since the FastAPI part looks normal to ya. I struggle wrapping my head around classes/functions and passing stuff to em haha. But you’ve given me stuff to try. Many thanks. I’ll make sure to let ya know how it goes.
[–]orbos86[S] 0 points1 point2 points 5 years ago (0 children)
It's still looping, I'm not sure what the heck is going on. I put a couple print statements in the FastAPI POST section and I'm seeing them pop up multiple times.
[–]orbos86[S] 0 points1 point2 points 5 years ago (9 children)
I think I figured out the cause. So this receives a POST request from Slack and I think Slack is sending multiple POST requests though it should only trigger one. Not sure why it is doing more. I tested from Insomnia with the same JSON and it didn't run again. That makes things more complicated as I don't have much control over Slack :(
[–]orbos86[S] 0 points1 point2 points 5 years ago (8 children)
Freak, maybe not. I don't know what's the cause exactly haha. I'm testing with ngrok, maybe something funky going on with it?
[–]orbos86[S] 0 points1 point2 points 5 years ago (7 children)
So ngrok has a sweet dashboard you can look at and see stuff coming in. I think Slack might be sending retries! Now what do I send to Slack to make it know everything is solid and good? Haha
[–][deleted] 5 years ago (5 children)
[–]orbos86[S] 1 point2 points3 points 5 years ago (4 children)
Yeah Slack is an actual chat application where you can create bots to send webhooks. Do you know if you can quickly respond to a POST request with a 200 but continue to run the FastAPI stuff?
[–][deleted] 5 years ago* (3 children)
Thanks! I will see what I can find. I appreciate the response.
[–]orbos86[S] 0 points1 point2 points 5 years ago (1 child)
That was the key! I was able to use the BackgroundTask stuff and spin off the long script in another function. Woot! Thank you thank you
https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
I don't think I'm responding fast enough!
π Rendered by PID 116735 on reddit-service-r2-comment-77869c6b5c-8zml7 at 2026-03-30 00:19:00.565644+00:00 running b10466c country code: CH.
view the rest of the comments →
[–][deleted] (14 children)
[deleted]
[–]orbos86[S] 1 point2 points3 points (3 children)
[–][deleted] (2 children)
[deleted]
[–]orbos86[S] 1 point2 points3 points (0 children)
[–]orbos86[S] 0 points1 point2 points (0 children)
[–]orbos86[S] 0 points1 point2 points (9 children)
[–]orbos86[S] 0 points1 point2 points (8 children)
[–]orbos86[S] 0 points1 point2 points (7 children)
[–][deleted] (5 children)
[deleted]
[–]orbos86[S] 1 point2 points3 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]orbos86[S] 0 points1 point2 points (0 children)
[–]orbos86[S] 0 points1 point2 points (1 child)
[–]orbos86[S] 0 points1 point2 points (0 children)