I have ASP.Net Core 2.1 application & my API controllers look as below.
[HttpPost]
public async Task<IActionResult> Post([FromBody]XElement recurlyXml)
{
var node = _xmlUtil.GetFirstNode(recurlyXml);
//do something
return Ok();
}
From postman, I am calling this API with below payload.
<updated_subscription_notification>
<subscription>
<plan>
<plan_code>1dpt</plan_code>
<name>Subscription One</name>
</plan>
<uuid>292332928954ca62fa48048be5ac98ec</uuid>
</subscription>
</updated_subscription_notification>
But on clicking Send(hit), its throwing 400 Bad Request. I tried with adding the below line on the top as well
<?xml version="1.0" encoding="UTF-8"?>
But still the same 400.
How do I pass XML to API Controller?
Thanks!
