I remember I read it somewhere that when submitting parameters values via ajax to API, there is an option so they don't show up in the URL. I've tried put them into data
like:
$.ajax({
type: "GET",
url: "/api/myController/myLunch",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: {"tableID":111, "firstCourse": "soup", ... }, // show up in header but not working
header: {"tableID":111, "firstCourse": "soup", ... }, // neither
success: function (data) { ... }
});
Controller get method:
[HttpGet]
[Route("myLunch")]
public IHttpActionResult myLunch(int tableID, string firstCourse, ...)
{ ... }
I kept getting 404 back. Basically I don't want to see like this:
/api/myController/myLunch?tableID=111&firstCourse=soup
I want to see only
/api/myController/myLunch