I am using a third party service that does an async callback to a URL I provide to them.
So I tell them to use http://www.mysite.com/Status/Incoming.
This must obviously map to an Incoming() method on my StatusController.
However, what I don't have control over is the format of the parameters they call my URL with.
E.g. They will do a callback such as: http://www.mysite.com/Status/Incoming?param1=val1¶m2=val2¶m3=val3
I want to map this to the parameters of my action method: Incoming(string param1, string param2, int param3)
How do I do this?
I have found a lot of stuff about custom routing, but nothing about legacy QueryString parameters.
Best Answer
There is no such thing as legacy query string parameters. There are query string parameters and they are part of the HTTP specification. And assuming that the
http://www.mysite.com/Status/Incoming?param1=val1¶m2=val2¶m3=val3
url is called you don't need any route to make it map to the following action (the default route will do just fine):The default model will take care of binding those values.