Niestety u mnie w pracy mój kierownik takiego komentowania wymaga. Mówi iż on to musi rozmieć, a niestety z .Net nie ma w ogóle nic wspólnego.
using System;
using System.Collections.Generic;
using System.Net.Http;
class Program
{
static void Main()
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://localhost:6740");
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("", "login")
});
var result = client.PostAsync("/api/Membership/exists", content).Result;
string resultContent = result.Content.ReadAsStringAsync().Result;
Console.WriteLine(resultContent);
}
}
}
StringContent content = new StringContent(HttpUtility.UrlEncode(action.Body), Encoding.UTF8, "application/x-www-form-urlencoded");
HttpResponseMessage sResponse = await sClient.PostAsync(action.URL, content ).ConfigureAwait(false);
Proszę metoda Clinet i wysyłanie stringa.