Skip to main content

HttpUtils

Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class HttpUtils

Properties

UseEncoding

View Source
Declaration
public static Encoding UseEncoding { get; set; }

Fields

UserAgent

View Source
Declaration
public static string UserAgent

ResultsFilter

View Source
Declaration
[ThreadStatic]
public static IHttpResultsFilter ResultsFilter

Methods

AddQueryParam(String, String, Object, Boolean)

View Source
Declaration
public static string AddQueryParam(this string url, string key, object val, bool encode = true)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringkey
System.Objectval
System.Booleanencode

AddQueryParam(String, Object, String, Boolean)

View Source
Declaration
public static string AddQueryParam(this string url, object key, string val, bool encode = true)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectkey
System.Stringval
System.Booleanencode

AddQueryParam(String, String, String, Boolean)

View Source
Declaration
public static string AddQueryParam(this string url, string key, string val, bool encode = true)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringkey
System.Stringval
System.Booleanencode

SetQueryParam(String, String, String)

View Source
Declaration
public static string SetQueryParam(this string url, string key, string val)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringkey
System.Stringval

AddHashParam(String, String, Object)

View Source
Declaration
public static string AddHashParam(this string url, string key, object val)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringkey
System.Objectval

AddHashParam(String, String, String)

View Source
Declaration
public static string AddHashParam(this string url, string key, string val)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringkey
System.Stringval

SetHashParam(String, String, String)

View Source
Declaration
public static string SetHashParam(this string url, string key, string val)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringkey
System.Stringval

HasRequestBody(String)

View Source
Declaration
public static bool HasRequestBody(string httpMethod)
Returns

System.Boolean

Parameters
TypeName
System.StringhttpMethod

GetRequestStreamAsync(WebRequest)

View Source
Declaration
public static Task<Stream> GetRequestStreamAsync(this WebRequest request)
Returns

System.Threading.Tasks.Task<System.IO.Stream>

Parameters
TypeName
System.Net.WebRequestrequest

GetRequestStreamAsync(HttpWebRequest)

View Source
Declaration
public static Task<Stream> GetRequestStreamAsync(this HttpWebRequest request)
Returns

System.Threading.Tasks.Task<System.IO.Stream>

Parameters
TypeName
System.Net.HttpWebRequestrequest

ConvertTo<TDerived, TBase>(Task<TDerived>)

View Source
Declaration
public static Task<TBase> ConvertTo<TDerived, TBase>(this Task<TDerived> task)
where TDerived : TBase
Returns

System.Threading.Tasks.Task<<TBase>>

Parameters
TypeName
System.Threading.Tasks.Task<<TDerived>>task
Type Parameters
  • TDerived
  • TBase

GetResponseAsync(WebRequest)

View Source
Declaration
public static Task<WebResponse> GetResponseAsync(this WebRequest request)
Returns

System.Threading.Tasks.Task<System.Net.WebResponse>

Parameters
TypeName
System.Net.WebRequestrequest

GetResponseAsync(HttpWebRequest)

View Source
Declaration
public static Task<HttpWebResponse> GetResponseAsync(this HttpWebRequest request)
Returns

System.Threading.Tasks.Task<System.Net.HttpWebResponse>

Parameters
TypeName
System.Net.HttpWebRequestrequest

IsAny300(Exception)

View Source
Declaration
public static bool IsAny300(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsAny400(Exception)

View Source
Declaration
public static bool IsAny400(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsAny500(Exception)

View Source
Declaration
public static bool IsAny500(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsNotModified(Exception)

View Source
Declaration
public static bool IsNotModified(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsBadRequest(Exception)

View Source
Declaration
public static bool IsBadRequest(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsNotFound(Exception)

View Source
Declaration
public static bool IsNotFound(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsUnauthorized(Exception)

View Source
Declaration
public static bool IsUnauthorized(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsForbidden(Exception)

View Source
Declaration
public static bool IsForbidden(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

IsInternalServerError(Exception)

View Source
Declaration
public static bool IsInternalServerError(this Exception ex)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex

GetStatus(Exception)

View Source
Declaration
public static HttpStatusCode? GetStatus(this Exception ex)
Returns

System.Nullable<System.Net.HttpStatusCode>

Parameters
TypeName
System.Exceptionex

GetStatus(WebException)

View Source
Declaration
public static HttpStatusCode? GetStatus(this WebException webEx)
Returns

System.Nullable<System.Net.HttpStatusCode>

Parameters
TypeName
System.Net.WebExceptionwebEx

HasStatus(Exception, HttpStatusCode)

View Source
Declaration
public static bool HasStatus(this Exception ex, HttpStatusCode statusCode)
Returns

System.Boolean

Parameters
TypeName
System.Exceptionex
System.Net.HttpStatusCodestatusCode

GetResponseBody(Exception)

View Source
Declaration
public static string GetResponseBody(this Exception ex)
Returns

System.String

Parameters
TypeName
System.Exceptionex

GetResponseBodyAsync(Exception, CancellationToken)

View Source
Declaration
public static async Task<string> GetResponseBodyAsync(this Exception ex, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Exceptionex
System.Threading.CancellationTokentoken

ReadToEnd(WebResponse)

View Source
Declaration
public static string ReadToEnd(this WebResponse webRes)
Returns

System.String

Parameters
TypeName
System.Net.WebResponsewebRes

ReadToEndAsync(WebResponse)

View Source
Declaration
public static Task<string> ReadToEndAsync(this WebResponse webRes)
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Net.WebResponsewebRes

ReadLines(WebResponse)

View Source
Declaration
public static IEnumerable<string> ReadLines(this WebResponse webRes)
Returns

System.Collections.Generic.IEnumerable<System.String>

Parameters
TypeName
System.Net.WebResponsewebRes

GetJsonFromUrl(String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string GetJsonFromUrl(this string url, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetJsonFromUrlAsync(String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> GetJsonFromUrlAsync(this string url, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

GetXmlFromUrl(String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string GetXmlFromUrl(this string url, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetXmlFromUrlAsync(String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> GetXmlFromUrlAsync(this string url, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

GetCsvFromUrl(String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string GetCsvFromUrl(this string url, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetCsvFromUrlAsync(String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> GetCsvFromUrlAsync(this string url, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

GetStringFromUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string GetStringFromUrl(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetStringFromUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> GetStringFromUrlAsync(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostStringToUrl(String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostStringToUrl(this string url, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostStringToUrlAsync(String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostStringToUrlAsync(this string url, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostToUrl(String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostToUrl(this string url, string formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.StringformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostToUrlAsync(String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostToUrlAsync(this string url, string formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.StringformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostToUrl(String, Object, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostToUrl(this string url, object formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.ObjectformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostToUrlAsync(String, Object, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostToUrlAsync(this string url, object formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.ObjectformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostJsonToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostJsonToUrl(this string url, string json, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringjson
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostJsonToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostJsonToUrlAsync(this string url, string json, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringjson
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostJsonToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostJsonToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostJsonToUrlAsync(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostJsonToUrlAsync(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostXmlToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostXmlToUrl(this string url, string xml, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringxml
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostXmlToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostXmlToUrlAsync(this string url, string xml, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringxml
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostCsvToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostCsvToUrl(this string url, string csv, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringcsv
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostCsvToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PostCsvToUrlAsync(this string url, string csv, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringcsv
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutStringToUrl(String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutStringToUrl(this string url, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutStringToUrlAsync(String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutStringToUrlAsync(this string url, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutToUrl(String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutToUrl(this string url, string formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.StringformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutToUrlAsync(String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutToUrlAsync(this string url, string formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.StringformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutToUrl(String, Object, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutToUrl(this string url, object formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.ObjectformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutToUrlAsync(String, Object, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutToUrlAsync(this string url, object formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.ObjectformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutJsonToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutJsonToUrl(this string url, string json, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringjson
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutJsonToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutJsonToUrlAsync(this string url, string json, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringjson
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutJsonToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutJsonToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutJsonToUrlAsync(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutJsonToUrlAsync(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutXmlToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutXmlToUrl(this string url, string xml, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringxml
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutXmlToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutXmlToUrlAsync(this string url, string xml, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringxml
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutCsvToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutCsvToUrl(this string url, string csv, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringcsv
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutCsvToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PutCsvToUrlAsync(this string url, string csv, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringcsv
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PatchStringToUrl(String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PatchStringToUrl(this string url, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PatchStringToUrlAsync(String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PatchStringToUrlAsync(this string url, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PatchToUrl(String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PatchToUrl(this string url, string formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.StringformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PatchToUrlAsync(String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PatchToUrlAsync(this string url, string formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.StringformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PatchToUrl(String, Object, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PatchToUrl(this string url, object formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.ObjectformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PatchToUrlAsync(String, Object, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PatchToUrlAsync(this string url, object formData = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.ObjectformData
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PatchJsonToUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PatchJsonToUrl(this string url, string json, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringjson
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PatchJsonToUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PatchJsonToUrlAsync(this string url, string json, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringjson
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PatchJsonToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PatchJsonToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PatchJsonToUrlAsync(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> PatchJsonToUrlAsync(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

DeleteFromUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string DeleteFromUrl(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

DeleteFromUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> DeleteFromUrlAsync(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

OptionsFromUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string OptionsFromUrl(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

OptionsFromUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> OptionsFromUrlAsync(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

HeadFromUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string HeadFromUrl(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

HeadFromUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<string> HeadFromUrlAsync(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

SendStringToUrl(String, String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string SendStringToUrl(this string url, string method = null, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Stringmethod
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

SendStringToUrlAsync(String, String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static async Task<string> SendStringToUrlAsync(this string url, string method = null, string requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Stringurl
System.Stringmethod
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

SendStringToUrl(HttpWebRequest, String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string SendStringToUrl(this HttpWebRequest webReq, string method, string requestBody, string contentType, string accept, Action<HttpWebRequest> requestFilter, Action<HttpWebResponse> responseFilter)
Returns

System.String

Parameters
TypeName
System.Net.HttpWebRequestwebReq
System.Stringmethod
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

SendStringToUrlAsync(HttpWebRequest, String, String, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static async Task<string> SendStringToUrlAsync(this HttpWebRequest webReq, string method, string requestBody, string contentType, string accept, Action<HttpWebRequest> requestFilter, Action<HttpWebResponse> responseFilter)
Returns

System.Threading.Tasks.Task<System.String>

Parameters
TypeName
System.Net.HttpWebRequestwebReq
System.Stringmethod
System.StringrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetBytesFromUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static byte[] GetBytesFromUrl(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.Byte[]

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetBytesFromUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<byte[]> GetBytesFromUrlAsync(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Byte[]>

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostBytesToUrl(String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static byte[] PostBytesToUrl(this string url, byte[] requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.Byte[]

Parameters
TypeName
System.Stringurl
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostBytesToUrlAsync(String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<byte[]> PostBytesToUrlAsync(this string url, byte[] requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Byte[]>

Parameters
TypeName
System.Stringurl
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutBytesToUrl(String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static byte[] PutBytesToUrl(this string url, byte[] requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.Byte[]

Parameters
TypeName
System.Stringurl
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutBytesToUrlAsync(String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<byte[]> PutBytesToUrlAsync(this string url, byte[] requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Byte[]>

Parameters
TypeName
System.Stringurl
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

SendBytesToUrl(String, String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static byte[] SendBytesToUrl(this string url, string method = null, byte[] requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.Byte[]

Parameters
TypeName
System.Stringurl
System.Stringmethod
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

SendBytesToUrlAsync(String, String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static async Task<byte[]> SendBytesToUrlAsync(this string url, string method = null, byte[] requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Byte[]>

Parameters
TypeName
System.Stringurl
System.Stringmethod
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

SendBytesToUrl(HttpWebRequest, String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static byte[] SendBytesToUrl(this HttpWebRequest webReq, string method, byte[] requestBody, string contentType, string accept, Action<HttpWebRequest> requestFilter, Action<HttpWebResponse> responseFilter)
Returns

System.Byte[]

Parameters
TypeName
System.Net.HttpWebRequestwebReq
System.Stringmethod
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

SendBytesToUrlAsync(HttpWebRequest, String, Byte[], String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static async Task<byte[]> SendBytesToUrlAsync(this HttpWebRequest webReq, string method, byte[] requestBody, string contentType, string accept, Action<HttpWebRequest> requestFilter, Action<HttpWebResponse> responseFilter, CancellationToken token)
Returns

System.Threading.Tasks.Task<System.Byte[]>

Parameters
TypeName
System.Net.HttpWebRequestwebReq
System.Stringmethod
System.Byte[]requestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

GetStreamFromUrl(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static Stream GetStreamFromUrl(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.IO.Stream

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

GetStreamFromUrlAsync(String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<Stream> GetStreamFromUrlAsync(this string url, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.IO.Stream>

Parameters
TypeName
System.Stringurl
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PostStreamToUrl(String, Stream, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static Stream PostStreamToUrl(this string url, Stream requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.IO.Stream

Parameters
TypeName
System.Stringurl
System.IO.StreamrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostStreamToUrlAsync(String, Stream, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<Stream> PostStreamToUrlAsync(this string url, Stream requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.IO.Stream>

Parameters
TypeName
System.Stringurl
System.IO.StreamrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

PutStreamToUrl(String, Stream, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static Stream PutStreamToUrl(this string url, Stream requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.IO.Stream

Parameters
TypeName
System.Stringurl
System.IO.StreamrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutStreamToUrlAsync(String, Stream, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

View Source
Declaration
public static Task<Stream> PutStreamToUrlAsync(this string url, Stream requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.IO.Stream>

Parameters
TypeName
System.Stringurl
System.IO.StreamrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

SendStreamToUrl(String, String, Stream, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>)

Returns HttpWebResponse Stream which must be disposed

View Source
Declaration
public static Stream SendStreamToUrl(this string url, string method = null, Stream requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.IO.Stream

Parameters
TypeName
System.Stringurl
System.Stringmethod
System.IO.StreamrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

SendStreamToUrlAsync(String, String, Stream, String, String, Action<HttpWebRequest>, Action<HttpWebResponse>, CancellationToken)

Returns HttpWebResponse Stream which must be disposed

View Source
Declaration
public static async Task<Stream> SendStreamToUrlAsync(this string url, string method = null, Stream requestBody = null, string contentType = null, string accept = "*/*", Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.IO.Stream>

Parameters
TypeName
System.Stringurl
System.Stringmethod
System.IO.StreamrequestBody
System.StringcontentType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter
System.Threading.CancellationTokentoken

GetResponseStatus(String)

View Source
Declaration
public static HttpStatusCode? GetResponseStatus(this string url)
Returns

System.Nullable<System.Net.HttpStatusCode>

Parameters
TypeName
System.Stringurl

GetErrorResponse(String)

View Source
Declaration
public static HttpWebResponse GetErrorResponse(this string url)
Returns

System.Net.HttpWebResponse

Parameters
TypeName
System.Stringurl

GetErrorResponseAsync(String)

View Source
Declaration
public static async Task<HttpWebResponse> GetErrorResponseAsync(this string url)
Returns

System.Threading.Tasks.Task<System.Net.HttpWebResponse>

Parameters
TypeName
System.Stringurl

UploadFile(WebRequest, Stream, String, String, String, Action<HttpWebRequest>, String, String)

View Source
Declaration
public static void UploadFile(this WebRequest webRequest, Stream fileStream, string fileName, string mimeType, string accept = null, Action<HttpWebRequest> requestFilter = null, string method = "POST", string field = "file")
Parameters
TypeName
System.Net.WebRequestwebRequest
System.IO.StreamfileStream
System.StringfileName
System.StringmimeType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Stringmethod
System.Stringfield

UploadFileAsync(WebRequest, Stream, String, String, String, Action<HttpWebRequest>, String, String, CancellationToken)

View Source
Declaration
public static async Task UploadFileAsync(this WebRequest webRequest, Stream fileStream, string fileName, string mimeType, string accept = null, Action<HttpWebRequest> requestFilter = null, string method = "POST", string field = "file", CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Net.WebRequestwebRequest
System.IO.StreamfileStream
System.StringfileName
System.StringmimeType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Stringmethod
System.Stringfield
System.Threading.CancellationTokentoken

UploadFile(WebRequest, Stream, String)

View Source
Declaration
public static void UploadFile(this WebRequest webRequest, Stream fileStream, string fileName)
Parameters
TypeName
System.Net.WebRequestwebRequest
System.IO.StreamfileStream
System.StringfileName

UploadFileAsync(WebRequest, Stream, String, CancellationToken)

View Source
Declaration
public static async Task UploadFileAsync(this WebRequest webRequest, Stream fileStream, string fileName, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Net.WebRequestwebRequest
System.IO.StreamfileStream
System.StringfileName
System.Threading.CancellationTokentoken

PostXmlToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostXmlToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostCsvToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PostCsvToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutXmlToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutXmlToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PutCsvToUrl(String, Object, Action<HttpWebRequest>, Action<HttpWebResponse>)

View Source
Declaration
public static string PutCsvToUrl(this string url, object data, Action<HttpWebRequest> requestFilter = null, Action<HttpWebResponse> responseFilter = null)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.Objectdata
System.Action<System.Net.HttpWebRequest>requestFilter
System.Action<System.Net.HttpWebResponse>responseFilter

PostFileToUrl(String, FileInfo, String, String, Action<HttpWebRequest>)

View Source
Declaration
public static WebResponse PostFileToUrl(this string url, FileInfo uploadFileInfo, string uploadFileMimeType, string accept = null, Action<HttpWebRequest> requestFilter = null)
Returns

System.Net.WebResponse

Parameters
TypeName
System.Stringurl
System.IO.FileInfouploadFileInfo
System.StringuploadFileMimeType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter

PostFileToUrlAsync(String, FileInfo, String, String, Action<HttpWebRequest>, CancellationToken)

View Source
Declaration
public static async Task<WebResponse> PostFileToUrlAsync(this string url, FileInfo uploadFileInfo, string uploadFileMimeType, string accept = null, Action<HttpWebRequest> requestFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Net.WebResponse>

Parameters
TypeName
System.Stringurl
System.IO.FileInfouploadFileInfo
System.StringuploadFileMimeType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Threading.CancellationTokentoken

PutFileToUrl(String, FileInfo, String, String, Action<HttpWebRequest>)

View Source
Declaration
public static WebResponse PutFileToUrl(this string url, FileInfo uploadFileInfo, string uploadFileMimeType, string accept = null, Action<HttpWebRequest> requestFilter = null)
Returns

System.Net.WebResponse

Parameters
TypeName
System.Stringurl
System.IO.FileInfouploadFileInfo
System.StringuploadFileMimeType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter

PutFileToUrlAsync(String, FileInfo, String, String, Action<HttpWebRequest>, CancellationToken)

View Source
Declaration
public static async Task<WebResponse> PutFileToUrlAsync(this string url, FileInfo uploadFileInfo, string uploadFileMimeType, string accept = null, Action<HttpWebRequest> requestFilter = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<System.Net.WebResponse>

Parameters
TypeName
System.Stringurl
System.IO.FileInfouploadFileInfo
System.StringuploadFileMimeType
System.Stringaccept
System.Action<System.Net.HttpWebRequest>requestFilter
System.Threading.CancellationTokentoken

UploadFile(WebRequest, FileInfo, String)

View Source
Declaration
public static WebResponse UploadFile(this WebRequest webRequest, FileInfo uploadFileInfo, string uploadFileMimeType)
Returns

System.Net.WebResponse

Parameters
TypeName
System.Net.WebRequestwebRequest
System.IO.FileInfouploadFileInfo
System.StringuploadFileMimeType

UploadFileAsync(WebRequest, FileInfo, String)

View Source
Declaration
public static async Task<WebResponse> UploadFileAsync(this WebRequest webRequest, FileInfo uploadFileInfo, string uploadFileMimeType)
Returns

System.Threading.Tasks.Task<System.Net.WebResponse>

Parameters
TypeName
System.Net.WebRequestwebRequest
System.IO.FileInfouploadFileInfo
System.StringuploadFileMimeType

DownloadFileTo(String, String, List<NameValue>)

View Source
Declaration
public static void DownloadFileTo(this string downloadUrl, string fileName, List<NameValue> headers = null)
Parameters
TypeName
System.StringdownloadUrl
System.StringfileName
System.Collections.Generic.List<ServiceStack.NameValue>headers

SetRange(HttpWebRequest, Int64, Nullable<Int64>)

View Source
Declaration
public static void SetRange(this HttpWebRequest request, long from, long? to)
Parameters
TypeName
System.Net.HttpWebRequestrequest
System.Int64from
System.Nullable<System.Int64>to

AddHeader(HttpWebRequest, String, String)

View Source
Declaration
public static void AddHeader(this HttpWebRequest res, string name, string value)
Parameters
TypeName
System.Net.HttpWebRequestres
System.Stringname
System.Stringvalue

GetHeader(HttpWebRequest, String)

View Source
Declaration
public static string GetHeader(this HttpWebRequest res, string name)
Returns

System.String

Parameters
TypeName
System.Net.HttpWebRequestres
System.Stringname

GetHeader(HttpWebResponse, String)

View Source
Declaration
public static string GetHeader(this HttpWebResponse res, string name)
Returns

System.String

Parameters
TypeName
System.Net.HttpWebResponseres
System.Stringname

WithHeader(HttpWebRequest, String, String)

View Source
Declaration
public static HttpWebRequest WithHeader(this HttpWebRequest httpReq, string name, string value)
Returns

System.Net.HttpWebRequest

Parameters
TypeName
System.Net.HttpWebRequesthttpReq
System.Stringname
System.Stringvalue

With(HttpWebRequest, Action<HttpRequestConfig>)

Populate HttpRequestMessage with a simpler, untyped API Syntax compatible with HttpClient's HttpRequestMessage

View Source
Declaration
public static HttpWebRequest With(this HttpWebRequest httpReq, Action<HttpRequestConfig> configure)
Returns

System.Net.HttpWebRequest

Parameters
TypeName
System.Net.HttpWebRequesthttpReq
System.Action<ServiceStack.HttpRequestConfig>configure