コード例 #1
0
ファイル: SolidHttpRequest.cs プロジェクト: HX-Rd/SolidHttp
 internal SolidHttpRequest(SolidHttpClient client, HttpMethod method, Uri url, CancellationToken cancellationToken)
 {
     Client            = client;
     BaseRequest       = new HttpRequestMessage(method, url);
     CancellationToken = cancellationToken;
 }
コード例 #2
0
ファイル: MethodExtensions.cs プロジェクト: HX-Rd/SolidHttp
 /// <summary>
 /// Performs a POST request
 /// </summary>
 /// <param name="client">The SolidHttpClient</param>
 /// <param name="url">The url to be requested</param>
 /// <param name="cancellationToken">The cancellation token for the request</param>
 /// <returns>SolidHttpRequest</returns>
 public static SolidHttpRequest PostAsync(this SolidHttpClient client, string url, CancellationToken cancellationToken)
 {
     return(client.PostAsync(new Uri(url, UriKind.RelativeOrAbsolute), cancellationToken));
 }
コード例 #3
0
ファイル: MethodExtensions.cs プロジェクト: HX-Rd/SolidHttp
 /// <summary>
 /// Performs a POST request
 /// </summary>
 /// <param name="client">The SolidHttpClient</param>
 /// <param name="url">The url to be requested</param>
 /// <returns>SolidHttpRequest</returns>
 public static SolidHttpRequest PostAsync(this SolidHttpClient client, Uri url)
 {
     return(client.PostAsync(url, CancellationToken.None));
 }
コード例 #4
0
ファイル: MethodExtensions.cs プロジェクト: HX-Rd/SolidHttp
 /// <summary>
 /// Performs a POST request
 /// </summary>
 /// <param name="client">The SolidHttpClient</param>
 /// <param name="url">The url to be requested</param>
 /// <returns>SolidHttpRequest</returns>
 public static SolidHttpRequest PostAsync(this SolidHttpClient client, string url)
 {
     return(client.PostAsync(new Uri(url, UriKind.RelativeOrAbsolute)));
 }
コード例 #5
0
ファイル: MethodExtensions.cs プロジェクト: HX-Rd/SolidHttp
 /// <summary>
 /// Performs a GET request
 /// </summary>
 /// <param name="client">The SolidHttpClient</param>
 /// <param name="url">The url to be requested</param>
 /// <param name="cancellationToken">The cancellation token for the request</param>
 /// <returns>SolidHttpRequest</returns>
 public static SolidHttpRequest GetAsync(this SolidHttpClient client, Uri url, CancellationToken cancellationToken)
 {
     return(client.PerformRequestAsync(HttpMethod.Get, url, cancellationToken));
 }
コード例 #6
0
ファイル: MethodExtensions.cs プロジェクト: HX-Rd/SolidHttp
        /// <summary>
        /// Performs a PATCH request
        /// </summary>
        /// <param name="client">The SolidHttpClient</param>
        /// <param name="url">The url to be requested</param>
        /// <param name="cancellationToken">The cancellation token for the request</param>
        /// <returns>SolidHttpRequest</returns>
        public static SolidHttpRequest PatchAsync(this SolidHttpClient client, Uri url, CancellationToken cancellationToken)
        {
            var patch = new HttpMethod("PATCH");

            return(client.PerformRequestAsync(patch, url, cancellationToken));
        }