Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个网络服务器,我想在某些情况下获得 HTTP 状态代码 418 'I'm a teapot',我确信我会使用 if 语句,但我似乎无法让它跳闸,有什么帮助吗?
<?php header("HTTP/1.1 418 I'm a teapot"); ?> <html> <h1>418 I'm a teapot</h1><br> <p>The HTCPCP Server is a teapot. The responding entity MAY be short and stout.</p> </html>
将导致:
HTCPCP 服务器是一个茶壶。响应实体可能矮而粗壮。