Ejemplo n.º 1
0
        public void CreateSubDirectory(NewFolderRequest newFolder)
        {
            var request = BuildNewFolderRequest(newFolder);

            var result = _base.RestClient.Post(request);

            if (result.StatusCode != HttpStatusCode.OK)
            {
                throw new Exception("Adding folder failed");
            }
        }
Ejemplo n.º 2
0
        private Request BuildNewFolderRequest(NewFolderRequest newFolder)
        {
            var request = new Request(ChomikujBase.NewFolderUrl);

            request.AddParameter("Password", newFolder.Password);
            request.AddParameter("NewFolderSetPassword", newFolder.PasswordSecured);
            request.AddParameter("AdultContent", newFolder.AdultContent);
            request.AddParameter("FolderName", newFolder.Name);

            request.AddParameter("__RequestVerificationToken", _base.RestClient.GetVerificationToken());
            request.AddParameter("FolderId", FolderId);
            request.AddParameter("ChomikId", ChomikId);

            return(request);
        }