Пример #1
0
        public object Execute(RestVerbs verbs, IParameterCollection parameters, SecureRest.TokenData tokenData, IRequest request, IHttpContext context)
        {
            if (tokenData.Equals(SecureRest.TokenData.None))
            {
                return new RestObject("401")
                       {
                           Error = "Not authorized. The specified API endpoint requires a token."
                       }
            }
            ;

            return(callback(new RestRequestArgs(verbs, parameters, request, tokenData, context)));
        }
    }
Пример #2
0
        public object Execute(RestVerbs verbs, IParameterCollection parameters, SecureRest.TokenData tokenData, IRequest request, IHttpContext context)
        {
            if (tokenData.Equals(SecureRest.TokenData.None))
            {
                return new RestObject("401")
                       {
                           Error = "未验证. 指定的API端点需要验证TOKEN."
                       }
            }
            ;

            return(callback(new RestRequestArgs(verbs, parameters, request, tokenData, context)));
        }
    }