PostmarkDotNet.PostmarkClient.TryGetPostmarkResponse C# (CSharp) Méthode

TryGetPostmarkResponse() private static méthode

private static TryGetPostmarkResponse ( Hammock.RestResponseBase response ) : PostmarkResponse
response Hammock.RestResponseBase
Résultat PostmarkResponse
        private static PostmarkResponse TryGetPostmarkResponse(RestResponseBase response)
        {
            PostmarkResponse result = null;
            var statusCode = (int)response.StatusCode;
            if (statusCode == 200 || statusCode == 401 || statusCode == 422 || statusCode == 500)
            {
                try
                {
                    result = JsonConvert.DeserializeObject<PostmarkResponse>(response.Content, _settings);
                }
                catch (JsonReaderException)
                {
                    result = null;
                }
            }
            return result;
        }