コード例 #1
0
ファイル: Client.cs プロジェクト: MNie/uploadcare-csharp
        /// <summary>
        /// Marks a file as deleted.
        /// </summary>
        /// <param name="fileId"> Resource UUID </param>
        public void DeleteFile(Guid fileId)
        {
            var url = Urls.ApiFile(fileId);

            var request = (HttpWebRequest)WebRequest.Create(url);

            request.Method = "DELETE";

            _requestHelper.ExecuteCommand(request, true);
        }
コード例 #2
0
ファイル: Client.cs プロジェクト: MNie/uploadcare-csharp
        /// <summary>
        /// Requests file data.
        /// </summary>
        /// <param name="fileId"> Resource UUID </param>
        /// <returns> UploadcareFile resource </returns>
        public UploadcareFile GetFile(Guid fileId)
        {
            var url = Urls.ApiFile(fileId);

            var request = (HttpWebRequest)WebRequest.Create(url);

            request.Method = "GET";

            var result = _requestHelper.ExecuteQuery(request, true, new FileData());

            return(new UploadcareFile(this, result));
        }