I have a custom complex type that I want to work with using Web API.
public class Widget { public int ID { get; set; } public string Name { get; set;
I think you can do this:
var client = new HttpClient(); HttpContent content = new Widget(); client.PostAsync("http://localhost:44268/api/test", content, new FormUrlEncodedMediaTypeFormatter()) .ContinueWith((postTask) => { postTask.Result.EnsureSuccessStatusCode(); });