What do the browser error codes mean?
★☆☆Status codes are issued by a server in response to a client's request made to the server. Typically when your browser requests a web page the host server will give the browser an informational response, a success report, a redirection request or an error.
Write a program that outputs what each of these HTTP status codes mean: 400, 401/403, 404. Any other code is an unknown error for the purpose of this program.
Remember to add a comment before a subprogram or selection statement to explain its purpose.
http_status so that it:Not found
# HTTP status codes program
# -------------------------
# Subprograms
# -------------------------
# Return the name of the HTTP error
---
def http_status(status):
---
match status:
---
# 400 error
---
case 400:
---
return "Bad request"
---
# 401 and 403 errors
---
case 401 | 403:
---
return "Authentication error"
---
# 404 error
---
case 404:
---
return "Not found"
---
# All other errors
---
case _:
---
return "Unknown error"
---
# -------------------------
# Main program
# -------------------------
code = 404
---
print(http_status(code))