This commit is contained in:
cdricms
2024-11-20 18:29:11 +01:00
parent cdae291dd8
commit e24c207bdc
4 changed files with 42 additions and 32 deletions

View File

@@ -1,8 +0,0 @@
code = 200
ct = "text/html"
content = "<!DOCTYPE html><html><body><h1>Bonjour!</h1></body></html>"
print(f"HTTP/1.1 {code}")
print(f"Content-Type: {ct}")
print(f"Content-Length: {len(content)}")
print()
print(content)

16
cgi/sleep.py Normal file
View File

@@ -0,0 +1,16 @@
import time
time.sleep(5)
code = 200
ct = "text/html"
content = "<!DOCTYPE html><html><body><h1>Je dormais!</h1></body></html>"
response = f"""
HTTP/1.1 {code}
Content-Type: {ct}
Content-Length: {len(content)}
{content}
"""
print(response)