Can anyone see what I’m doing wrong with this GET request to my API (from Fiddler):
http://localhost:51488/api/searchapi/Demo&Dte=2012-08-25&Nts=1
It returns a 400 Bad Request HTTP response.
My route is:
routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
My SearchAPIController.cs is:
// GET api/searchapi
public IEnumerable<RatesViewModel> Get(string id, DateTime Dte, int Nts)
{
So I would expect:
id = "Demo"
Dte = 2012-08-25
Nts = 1
But it just doesn’t appear to get as far as the controller.
Thanks for any help,
Mark
should be:
Notice that query string parameters start with a question mark (
?).