📜  响应 404 请求 python 比较 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:23.329000             🧑  作者: Mango

代码示例1
Look at the r.status_code attribute:

if r.status_code == 404:
    # A 404 was issued.

e.g.:

>>> import requests
>>> r = requests.get('http://httpbin.org/status/404')
>>> r.status_code
404