I am new to python
and HTTP request
, and I am trying to implement HTTP request between two functions, which I am not sure will work. Can you read my thoughts and give me some suggestions/examples on how to implement them?
Here's what I expect: Let's call these two functions A and B; B is the while true loop, and both A and B are in different threads.
When A receive a post request with a body
B will create a txt file in my file system
A will receive the txt file path and write "hello world" into it
Is that something I can do with python
and HTTP request
. My intutitive thought is I can use thread and lock to implement it, but I am not sure on how to do it. Can you give me some idea or suggestions?