Async Call
Async Call
com/Articles/234085/Fixing-WCF-to-build-highly-scalable-a
sync-REST-API
http://blog.anthonybaker.me/2013/05/consuming-json-rest-api-asynchronously.html
http://aleksanderspro.wordpress.com/2013/02/19/consuming-rest-service-async-in-p
cl/
http://blog.anthonybaker.me/2013/05/how-to-consume-json-rest-api-in-net.html
http://www.asp.net/web-api/overview/web-api-clients/calling-a-web-api-from-a-net
-client
http://blogs.msdn.com/b/henrikn/archive/2012/02/11/httpclient-is-here.aspx
public string Post<t>(T data)
{
using (var httpClient = NewHttpClient())
{
var requestMessage = GetHttpRequestMessage<t>(data);
var result = httpClient.PostAsync(_endpoint, requestMessage.Content)
.Result;
return result.Content.ToString();
}
}
}
else
{
MessageBox.Show("Error Code" +
response.StatusCode + " : Message - " + response.ReasonPhrase);
}