Created
April 23, 2024 19:56
-
-
Save ShahriyarR/1fb1665d8adfeafcdf86f90459bf342e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import threading | |
def send_request(user_id, new_email): | |
response = requests.post(f'http://127.0.0.1:5000/change_email/{user_id}', data={'email': new_email}) | |
print(response.text) | |
# Create threads to simulate concurrent requests | |
thread1 = threading.Thread(target=send_request, args=('1', 'newemail1@example.com')) | |
thread2 = threading.Thread(target=send_request, args=('2', 'newemail2@example.com')) | |
thread1.start() | |
thread2.start() | |
thread1.join() | |
thread2.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment