コード例 #1
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 public static void SetCookie(this HttpService http, string url, string name, string value) =>
 http.SetCookie(new Uri(url), name, value);
コード例 #2
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 public static void RemoveCookie(this HttpService http, string url, string name) =>
 http.RemoveCookie(new Uri(url), name);
コード例 #3
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #4
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #5
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #6
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #7
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #8
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #9
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #10
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #11
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #12
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #13
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #14
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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;
コード例 #15
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #16
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);
コード例 #17
0
ファイル: HttpServiceExtensions.cs プロジェクト: chubrik/Kit
 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);