I'm designing 2 websites and wanna send a json from the first website to the second:
// Action from the first website
public async Task<ActionResult> Index()
{
using (var client = new HttpClient())
{
var package = new Dictionary<string, string>()
{
{ "Name", "Julie" }
{ "Address", "UK" }
};
string json = JsonConvert.SerializeObject(package);
var response = await client.PostAsync("thesecondsite.com/contacts/info", ???);
}
}
Action Info
of the Contacts
controller in the second website:
[HttpPost]
public ActionResult Info()
{
// How can I catch the json here?
// string json = ...
}
Can you tell me how to get the json?
p/s: Sorry for give me the code
question, I'd been looking for on Google search but no sample was found in my case. I wanna do this in server side instead of using ajax in client side.