Ejemplo n.º 1
0
 internal SolidHttpRequest(SolidHttpClient client, HttpMethod method, Uri url, CancellationToken cancellationToken)
 {
     Client            = client;
     BaseRequest       = new HttpRequestMessage(method, url);
     CancellationToken = cancellationToken;
 }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
 /// <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));
 }
Ejemplo n.º 4
0
 /// <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)));
 }
Ejemplo n.º 5
0
 /// <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));
 }
Ejemplo n.º 6
0
        /// <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));
        }