Ejemplo n.º 1
0
        public bool MakeRequest(string movieTitle, string requestMessage)
        {
            this.CheckAppKey();
            this.CheckLoggedIn();

            if (string.IsNullOrWhiteSpace(movieTitle))
            {
                throw new ArgumentException("Movie title cannot be null or empty.");
            }
            else if (string.IsNullOrWhiteSpace(requestMessage))
            {
                throw new ArgumentException("Request message cannot be null or empty.");
            }
            else
            {
                try
                {
                    var req  = YifyAPI.GetMakeRequestReqeust(this.appKey, this.userKey, movieTitle, requestMessage);
                    var res  = YifyAPI.SendPostRequest(req);
                    var xDoc = _parser.ToResponse(res);
                    return(true);
                }
                catch (Exception ex) { throw new YifyException("An error occurred. See inner exception for more details", ex); }
            }
        }