Ejemplo n.º 1
0
        public async Task <HttpResponseMessage> PostAysnc <T>(string url, T parm)
        {
            var dic    = DictionaryFormatter.MapToDictionary(parm);
            var result = await _httpClient.PostAsync(url, new FormUrlEncodedContent(dic));

            return(result);
        }
Ejemplo n.º 2
0
        public async Task <T> PostAysnc <T>(string url, object parm)
        {
            var dic    = DictionaryFormatter.MapToDictionary(parm);
            var result = await _httpClient.PostAsync(url, new FormUrlEncodedContent(dic));

            return(await result.Content.ReadAsAsync <T>());
        }