2016-05-16 10 views

答えて

3

あなたのAPIレスポンスを設計するための多くの方法があります。あなたのアーキテクチャ、技術、およびその他の側面に条件付きです。このトピックは取るに関する詳細情報については

{ 
    "status": "error", 
    "code": 404, 
    "data": null, /* or optional error payload */ 
    "message": "Error xyz has occurred" 
} 

{ 
    "status": "success", 
    "data": { 
      /* Application-specific data would go here. */ 
    }, 
    "message": null /* Or optional success message */ 
} 

失敗した要求:あなたの例に基づいて

、私はこのように

成功した要求を応答しますこのリンクを見てください

Standard JSON API response format?

Best Practices for Designing a Pragmatic RESTful API

REST API Error Codes 101

関連する問題