Q:

How to handle a POST method that also has a parameter of unknown type?

I am coding to handle a Facebook callback. Facebook calls the same Url with POST but with different object types.  I am not ready to handle all the parameter types, so I tried the following:
public void Post([FromBody]class1 webhook1)
{  // for object1 
}

public void Post([FromBody]class2 webhook2)
{  // for object12
}

public async Task Post()
{
    string rawData = await Request.Content.ReadAsStringAsync();
    log(rawData);
}

However, I get this exception:
"Multiple actions were found that match the request ...

Is there a way to allow a fallback option for parameter types I am not ready to handle?

A:

Method overloading based on the type of parameter is not supported for "web" routing methods
Use route attribute:
[Route("webhook1")]
public void Post([FromBody]class1 webhook1) {}

[Route("webhook2")]
public void Post([FromBody]class2 webhook2) {}

Or if you don't want client side to know about different parameter's types,
then make one "web" method where you read raw data from the body of request,
detect a type of data and call correspondent method to handle it

