Esempio n. 1
0
        public async Task <JSON_Uploadedfile> ImageMove(string ImagePath, string DestinationFolderPath)
        {
            using (HtpClient localHtpClient = new HtpClient(new HCHandler {
            }))
            {
                using (HttpResponseMessage response = await localHtpClient.PutAsync(new pUri("move?" + string.Format("source={0}&Target_path={1}", ImagePath.Slash(), DestinationFolderPath.Trim('/'))), null).ConfigureAwait(false))
                {
                    string result = await response.Content.ReadAsStringAsync();

                    return(response.StatusCode == HttpStatusCode.OK ? JsonConvert.DeserializeObject <JSON_Uploadedfile>(JObject.Parse(result).SelectToken("movedFile").ToString(), JSONhandler) : throw ShowError(result));
                }
            }
        }