Exemplo n.º 1
0
        public string PostCommand(string address, string username, string password, string command)
        {
            address = String.Format("http://{0}/jsonrpc", address);

            _logger.Debug("Posting command: {0}, to {1}", command, address);

            byte[] byteArray = Encoding.ASCII.GetBytes(command);

            var wc = new NzbDroneWebClient();

            wc.Credentials = new NetworkCredential(username, password);

            var response = wc.UploadData(address, "POST", byteArray);
            var text     = Encoding.ASCII.GetString(response);

            return(text.Replace(" ", " "));
        }
Exemplo n.º 2
0
        public string PostCommand(string address, string username, string password, string command)
        {
            address = String.Format("http://{0}/jsonrpc", address);

            _logger.Debug("Posting command: {0}, to {1}", command, address);

            byte[] byteArray = Encoding.ASCII.GetBytes(command);

            var wc = new NzbDroneWebClient();
            wc.Credentials = new NetworkCredential(username, password);

            var response = wc.UploadData(address, "POST", byteArray);
            var text = Encoding.ASCII.GetString(response);

            return text.Replace(" ", " ");
        }