コード例 #1
0
        /// <summary>
        /// A method that will throw an exception which looks like {"error":"invalid_request","error_description":"The authorization code was not found or was already used"}
        /// This error is thrown when trying to authorize an OAuth code that has already been used.
        /// </summary>
        public void ThrowOAuthCodeUsedException()
        {
            var response = new RestResponse()
            {
                RawBytes          = Encoding.UTF8.GetBytes("{\"error\":\"invalid_request\",\"error_description\":\"The authorization code was not found or was already used\"}"),
                StatusCode        = HttpStatusCode.NotAcceptable,
                StatusDescription = "Not Acceptable"
            };

            RequestEngine.CheckResponseExceptions(response);
        }