Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

How to pass multiple complex objects to Web API action

$
0
0

suppose this is sample action

public void StartProcessiong([FromBody]Content content, [FromBody]Config config)
{

}

OR

public void StartProcessiong(Content content, Config config)
{

}

client code
-----------
using (var httpClient = new System.Net.Http.HttpClient())
{
    httpClient.BaseAddress = new Uri(ConfigurationManager.AppSettings["Url"]);
    httpClient.DefaultRequestHeaders.Accept.Clear();
    httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));   

    var response = httpClient.PutAsync("api/process/StartProcessiong", objectA, objectB);
}

taking code from http://stackoverflow.com/questions/24874490/pass-multiple-complex-objects-to-a-post-put-web-api-method

how to use http client to pass multiple complex object too....need sample code. thanks


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>