Ejemplo n.º 1
0
        public static async Task DeleteAsync(string path)
        {
            AdvancedHttpClient client = new AdvancedHttpClient
            {
                BaseAddress = new Uri(BaseUri)
            };

            await client.DeleteAsync(path);
        }
Ejemplo n.º 2
0
 private async Task DeleteAsync(string endpoint)
 {
     try
     {
         using (AdvancedHttpClient client = new AdvancedHttpClient(MixItUpAPIEndpoint))
         {
             await client.DeleteAsync(endpoint);
         }
     }
     catch (Exception ex) { Logger.Log(ex); }
 }
 /// <summary>
 /// Performs a DELETE REST request using the provided request URI.
 /// </summary>
 /// <param name="requestUri">The request URI to use</param>
 /// <param name="content">The content to send</param>
 /// <returns>A type-casted object of the contents of the response</returns>
 protected async Task <T> DeleteAsync <T>(string requestUri, HttpContent content = null)
 {
     using (AdvancedHttpClient client = await this.GetHttpClient())
     {
         try
         {
             client.RateLimitUpdateOccurred += Client_RateLimitUpdateOccurred;
             return(await client.DeleteAsync <T>(requestUri, content));
         }
         finally
         {
             client.RateLimitUpdateOccurred -= Client_RateLimitUpdateOccurred;
         }
     }
 }