V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hobbyliu
V2EX  ›  问与答

ResetfulApi 规范 status_code 的一些困惑。

  •  
  •   hobbyliu · Jul 15, 2015 · 2442 views
    This topic created in 3939 days ago, the information mentioned may be changed or developed.

    最近看一些 api 接口规范 resetful ,发现没有定义errorcode,用的是 http 的状态码
    这样显然错误码不够用,这样做的好处是什么?求大神指导。

    3 replies    2015-07-15 23:02:36 +08:00
    learnshare
        1
    learnshare  
       Jul 15, 2015
    状态码是为了统一,这样就可以与其他 HTTP 程序兼容。
    不够用可以在此基础上定义私有状态,或者加一个 error code
    mfaner
        2
    mfaner  
       Jul 15, 2015
    是RESTful不是resetful
    hobbyliu
        3
    hobbyliu  
    OP
       Jul 15, 2015
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5641 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 67ms · UTC 08:30 · PVG 16:30 · LAX 01:30 · JFK 04:30
    ♥ Do have faith in what you're doing.