V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
MarioLuisGarcia
V2EX  ›  问与答

如何触发 HTTP 418 状态?

  •  
  •   MarioLuisGarcia · 2015-10-30 21:08:21 +08:00 · 8706 次点击
    这是一个创建于 3110 天前的主题,其中的信息可能已经有所发展或是发生改变。
    刚才在查看 HTTP 所有状态列表。发现 418 是个彩蛋:“ I'm a teapot".
    https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
    7 条回复    2015-10-31 14:09:37 +08:00
    xfspace
        1
    xfspace  
       2015-10-30 21:11:12 +08:00
    server {
    listen 80;
    return 418;
    }
    MarioLuisGarcia
        2
    MarioLuisGarcia  
    OP
       2015-10-30 21:17:28 +08:00
    @xfspace 如果是访问别人的网站呢。
    cloverstd
        3
    cloverstd  
       2015-10-30 21:17:49 +08:00
    HTTP 状态码可以随便你怎么返回给客户端
    xfspace
        4
    xfspace  
       2015-10-30 21:19:42 +08:00
    @MarioLuisGarcia 你在逗我吗。
    Slienc7
        5
    Slienc7  
       2015-10-30 21:41:15 +08:00
    @MarioLuisGarcia “ and is not expected to be implemented by actual HTTP servers. ”
    choury
        6
    choury  
       2015-10-30 22:12:48 +08:00   ❤️ 3
    MarioLuisGarcia
        7
    MarioLuisGarcia  
    OP
       2015-10-31 14:09:37 +08:00
    @xfspace choury 在 6 楼给出了一个应用。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1039 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:08 · PVG 02:08 · LAX 11:08 · JFK 14:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.