public async Task <bool> Remove(string VideoID)
        {
            using (HtpClient localHttpClient = new HtpClient(new HCHandler()))
            {
                HttpResponseMessage ResPonse = await localHttpClient.DeleteAsync(new pUri($"/me/watchlater/{VideoID}")).ConfigureAwait(false);

                return(ResPonse.StatusCode == System.Net.HttpStatusCode.OK ? true : throw ShowError(await ResPonse.Content.ReadAsStringAsync()));
            }
        }
Example #2
0
        public async Task <bool> Remove(string VideoID)
        {
            using (HtpClient localHttpClient = new HtpClient(new HCHandler()))
            {
                var RequestUri = new pUri(string.Format("/me/history/{0}", VideoID));
                HttpResponseMessage ResPonse = await localHttpClient.DeleteAsync(RequestUri).ConfigureAwait(false);

                return(ResPonse.StatusCode == System.Net.HttpStatusCode.OK ? true : throw ShowError(await ResPonse.Content.ReadAsStringAsync()));
            }
        }
Example #3
0
        public async Task <bool> Delete()
        {
            using (HtpClient localHttpClient = new HtpClient(new HCHandler()))
            {
                var RequestUri = new pUri($"/playlist/{PlaylistID}");
                HttpResponseMessage ResPonse = await localHttpClient.DeleteAsync(RequestUri).ConfigureAwait(false);

                return(ResPonse.StatusCode == System.Net.HttpStatusCode.OK ? true : throw ShowError(await ResPonse.Content.ReadAsStringAsync()));
            }
        }
Example #4
0
        public async Task <bool> UnFollow(string UserID)
        {
            using (HtpClient localHttpClient = new HtpClient(new HCHandler()))
            {
                HttpResponseMessage ResPonse = await localHttpClient.DeleteAsync(new pUri($"/me/following/{UserID}")).ConfigureAwait(false);

                var result = await ResPonse.Content.ReadAsStringAsync();

                return(ResPonse.IsSuccessStatusCode ? true : throw ShowError(await ResPonse.Content.ReadAsStringAsync()));
            }
        }
Example #5
0
        public async Task <JSON_Uploadedfile> FolderDelete(string FolderPath)
        {
            using (HtpClient localHtpClient = new HtpClient(new HCHandler {
            }))
            {
                using (HttpResponseMessage response = await localHtpClient.DeleteAsync(new pUri("deletefolder?" + string.Format("path={0}", FolderPath.Trim('/')))).ConfigureAwait(false))
                {
                    string result = await response.Content.ReadAsStringAsync();

                    return(response.StatusCode == HttpStatusCode.OK ? JsonConvert.DeserializeObject <JSON_Uploadedfile>(JObject.Parse(result).SelectToken("deletedFolder").ToString(), JSONhandler) : throw ShowError(result));
                }
            }
        }
Example #6
0
        public async Task <bool> Delete(string IDen)
        {
            using (HtpClient localHttpClient = new HtpClient(new HCHandler()))
            {
                var RequestUri = new pUri($"devices/{IDen}");
                HttpResponseMessage ResPonse = await localHttpClient.DeleteAsync(RequestUri).ConfigureAwait(false);

                var result = await ResPonse.Content.ReadAsStringAsync();

                if (ResPonse.StatusCode == HttpStatusCode.OK)
                {
                    return(true);
                }
                else
                {
                    ShowError(result);
                    return(false);
                }
            }
        }