public static void SetCookie(this HttpService http, string url, string name, string value) => http.SetCookie(new Uri(url), name, value);
public static void RemoveCookie(this HttpService http, string url, string name) => http.RemoveCookie(new Uri(url), name);
public static IHttpResponse PostObject <T>( this HttpService http, Uri uri, T obj, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => Task.Run(() => http.PostObjectAsync(uri, obj, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;
public static Task <IHttpResponse> PostObjectAsync <T>( this HttpService http, string url, T obj, CancellationToken cancellationToken, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.PostObjectAsync(new Uri(url), obj, cancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
public static IHttpResponse PostBytes( this HttpService http, string url, byte[] bytes, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => Task.Run(() => http.PostBytesAsync(new Uri(url), bytes, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;
public static Task <IHttpResponse> PostBytesAsync( this HttpService http, Uri uri, byte[] bytes, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.PostBytesAsync(uri, bytes, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
public static IHttpResponse PostMultipart( this HttpService http, Uri uri, Dictionary <string, string> multipart, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => Task.Run(() => http.PostMultipartAsync(uri, multipart, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;
public static T GetObject <T>( this HttpService http, Uri uri, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) where T : class, new() => Task.Run(() => http.GetObjectAsync <T>(uri, Kit.CancellationToken, cache : cache, cacheKey : cacheKey, repeat : repeat, timeoutSeconds : timeoutSeconds)).Result;
public static Task <IHttpResponse> PostFormAsync( this HttpService http, string url, IEnumerable <KeyValuePair <string, string> > form, CancellationToken cancellationToken, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.PostFormAsync(new Uri(url), form, cancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
public static Task <string> GetTextAsync( this HttpService http, Uri uri, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.GetTextAsync(uri, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
public static IHttpResponse PostForm( this HttpService http, Uri uri, IEnumerable <KeyValuePair <string, string> > form, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => Task.Run(() => http.PostFormAsync(uri, form, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;
public static Stream GetStream( this HttpService http, string url, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => Task.Run(() => http.GetStreamAsync(new Uri(url), Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;
public static Task <T> GetObjectAsync <T>( this HttpService http, string url, CancellationToken cancellationToken, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) where T : class, new() => http.GetObjectAsync <T>(new Uri(url), cancellationToken, cache : cache, cacheKey : cacheKey, repeat : repeat, timeoutSeconds : timeoutSeconds);
public static byte[] GetBytes( this HttpService http, Uri uri, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => Task.Run(() => http.GetBytesAsync(uri, Kit.CancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;
public static Task <IHttpResponse> PostMultipartAsync( this HttpService http, string url, Dictionary <string, string> multipart, CancellationToken cancellationToken, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.PostMultipartAsync(new Uri(url), multipart, cancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
public static Task <byte[]> GetBytesAsync( this HttpService http, string url, CancellationToken cancellationToken, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.GetBytesAsync(new Uri(url), cancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
public static Task <dynamic> GetObjectAsync( this HttpService http, Uri uri, CancellationToken cancellationToken, CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) => http.GetObjectAsync <object>(uri, cancellationToken, cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);