AppHarbor.Commands.AddDrainCommand.InnerExecute C# (CSharp) Method

InnerExecute() protected method

protected InnerExecute ( string arguments ) : void
arguments string
return void
        protected override void InnerExecute(string[] arguments)
        {
            var request = new RestRequest("applications/{slug}/drains", Method.POST)
            {
                RequestFormat = DataFormat.Json
            }
                .AddUrlSegment("slug", ApplicationId)
                .AddHeader("Authorization", string.Format("BEARER {0}", _accessToken))
                .AddBody(new { url = arguments[0] });

            var response = _restClient.Execute(request);

            if (response.StatusCode != HttpStatusCode.Created)
            {
                throw new CommandException(response.Content);
            }
        }