I am trying to access a 3rd party API. The documentation of the 3rd party API provider has given the following PHP code on how to access the data sent. My code is written in C# dotnetcore. I have tried several ways to access the API but I get a Error 415. Can someone help me resolve this.
<?php
$mmid = $_POST['mm_id'];
$ooid = $_POST['oo_id'];
?>
My C# Code
[HttpPost("b_notice")]
[ProducesResponseType(typeof(string), (int)HttpStatusCode.OK)]
public async Task<ActionResult> APIUrl(string mm_id)
{
try
{
return Ok(mm_id);
}
catch (Exception ex)
{
return BadRequest(ex.Message);
}
}
The response code I get is 415 Unsupported Media Type. . I think they don;t use JSON. Can someone help me resolve this ?
Note: The 3rd party provider says they use 'application/x-www-form-urlencoded.