Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AnErrupTion authored May 11, 2019
1 parent f7b8e31 commit f88691f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions xNet/~Http/~Helpers/HttpHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace xNet.xNet._Http
{
class HttpHelper
{
public HttpResponse Send(HttpMethod method, string address, HttpContent content = null)
{
#region Проверка параметров

if (address == null)
{
throw new ArgumentNullException("address");
}

if (address.Length == 0)
{
throw ExceptionHelper.EmptyString("address");
}

#endregion

return Raw(method, address, content);
}

private HttpResponse Raw(HttpMethod method, string address, HttpContent content = null)
{
#region Проверка параметров

if (address == null)
{
throw new ArgumentNullException("address");
}

if (address.Length == 0)
{
throw ExceptionHelper.EmptyString("address");
}

#endregion

var uri = new Uri(address, UriKind.RelativeOrAbsolute);
return new HttpRequest().Raw(method, uri, content);
}
}
}

0 comments on commit f88691f

Please sign in to comment.