所以问题就是这样,对于我的所有REST API端点,我的RESPONSE Body中应该总共有3个字段,例如:
{
"status": "SUCCESS",
"message": "A list of a recent post",
"data" : [LIST OF POSTS]
}
要么
{
"status" : "NOT_AUTHORIZED",
"message": "User does not have previledge to access this resource",
"errors": ["User does not have Admin access"]
}
所以你可以得到这个想法,我希望这个消息状态错误或数据字段存在于我的REST API中的所有响应中。
杨魅力
ABOUTYOU
相关分类