cevincheung
V2EX  ›  问与答

对于不存在的用户或其他非页面资源,你是提示对象不存在还是页面不存在?

  •  
  •   cevincheung · Jan 24, 2015 · 1834 views
    This topic created in 4158 days ago, the information mentioned may be changed or developed.

    比如 /user/1123123 你是会提示页面不存在还是一个用户不存在?

    3 replies    2015-01-25 10:55:36 +08:00
    abelyao
        1
    abelyao  
       Jan 24, 2015
    如果类似 /user/1123123 说明已经在资源标识中标明这个一个 user 对象的请求了,有好一些就提示用户不存在。而如果是 /lasdjasldj 那么就提示页面不存在。
    其实都可以啦,没必要这么纠结。
    Sunyanzi
        2
    Sunyanzi  
       Jan 25, 2015
    昨天刚讨论过这个问题 ...

    响应头是 404 Not Found ... 响应体是 {"error":101,"message":"User Not Found" } ...
    loveminds
        3
    loveminds  
       Jan 25, 2015
    user,自然是用户不存在,然后顺带输出设计妹子的一句话
    Failure does not imply you have wasted time and life. It shows you have reasons to start again--Yammi
    失败并不意味着你浪费了时间和生命,而是表明你有理由重新开始——小芸
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2713 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:36 · PVG 23:36 · LAX 08:36 · JFK 11:36
    ♥ Do have faith in what you're doing.