You can define a separate route for each method like the following code:
public class ContactsController : ApiController
{
[Route("api/Contacts/Students")]
public void Post([FromBody] Student student)
{
}
[Route("api/Contacts/Employees")]
public void Post([FromBody] Employee employee)
{
}
}
Otherwise, Web API will throw an exception owing to ambiguity.