From 3604e77b4385fb6ddb04a74fd15fdf85c7346174 Mon Sep 17 00:00:00 2001 From: jsakamoto Date: Mon, 1 Sep 2014 21:36:00 +0900 Subject: [PATCH] collect garbage of source code. --- VoiceTextWebAPI.Client/VoiceTextClient.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/VoiceTextWebAPI.Client/VoiceTextClient.cs b/VoiceTextWebAPI.Client/VoiceTextClient.cs index ca04bc9..21eb873 100644 --- a/VoiceTextWebAPI.Client/VoiceTextClient.cs +++ b/VoiceTextWebAPI.Client/VoiceTextClient.cs @@ -49,28 +49,18 @@ public byte[] GetVoice(string text) return bytes; } - //public async Task GetVoiceAsync(string text) - //{ - // var httpClinet = CreateHttpClient(); - // var content = BuildHttpRequestContent(text); - // var response = await httpClinet.PostAsync(this.APIEndPoint, content); - // if (response.StatusCode != HttpStatusCode.OK) ThrowVoiceTextException(response); - // var bytes = await response.Content.ReadAsByteArrayAsync(); - // return bytes; - //} - public Task GetVoiceAsync(string text) { var httpClinet = CreateHttpClient(); var content = BuildHttpRequestContent(text); - var x = httpClinet.PostAsync(this.APIEndPoint, content) + return httpClinet.PostAsync(this.APIEndPoint, content) .ContinueWith(t => { var response = t.Result; if (response.StatusCode != HttpStatusCode.OK) ThrowVoiceTextException(response); return response.Content.ReadAsByteArrayAsync(); - }); - return x.Unwrap(); + }) + .Unwrap(); } private HttpClient CreateHttpClient()