25 lines
510 B
C#
25 lines
510 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
|
|
namespace Blog3000.Shared
|
|
{
|
|
public static class HttpExtensions
|
|
{
|
|
|
|
public static WebExceptionStatus? GetStatusCode(this HttpRequestException ex)
|
|
{
|
|
{
|
|
if (ex.InnerException is WebException webException)
|
|
{
|
|
return webException.Status;
|
|
}
|
|
return null;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|