public async Task <ActionOutput> DoAction(ActionEnum input) { var json = new ActionInput { Action = input.ToString().ToLower() + Global.DoActionVersion }; HttpContent contentPost = new StringContent(json.ToJsonString(), Encoding.UTF8, "application/json"); var response = await Client.PostAsync("my-kirito/doaction", contentPost); Console.WriteLine("{0} {1} {2}", "開始行動", input.GetDescriptionText(), response.StatusCode); var content = response.Content; if (response.IsSuccessStatusCode) { var output = await content.ReadAsJsonAsync <ActionOutput>(); Console.WriteLine(output.Message); return(output); } await OnErrorOccur(response.StatusCode, content, "行動", ConsoleColor.Yellow); return(null); }