mercredi 5 décembre 2018

how to call web api post method in asp.net with multiple arguments

I am writing a simple web api application,[and i beginner in web api and mvc ] i want writing post methode to add record like this:

[Route("api/{Inspection}/{post}/{date}/{inspectorId}/{unitID}/{time}")]
    [HttpPost]
    public void PostInspection(string date,int inspectorId,int unitID,string time)
    {
        InspectionDataClass inspectionData = new InspectionDataClass();
        inspectionData.InsertRow(date,inspectorId,unitID,false,false,"", time);}

and call methode in browser like this:

http://localhost:34367/api/inspection/97/3/13/10

but doesn't execute. please help me




Aucun commentaire:

Enregistrer un commentaire