Лаб6 - оценка 4

This commit is contained in:
Rakshasa2
2026-11-19 18:40:32 +03:00
parent 470d9d6f1e
commit dbce1eb574
62 changed files with 6087 additions and 15 deletions
+14
View File
@@ -0,0 +1,14 @@
import requests, time
base = 'http://localhost:8080'
headers = {'Authorization': 'Bearer invalid_token_12345'}
print('Generating errors for 240 seconds...')
for i in range(240):
try:
r = requests.get(f'{base}/api/v1/users/me', headers=headers, timeout=2)
print(f'{i+1}/240: status={r.status_code}', end='\r')
except Exception as e:
print(f'{i+1}/240: error', end='\r')
time.sleep(1)
print('\nDone')