jeudi 2 juillet 2015

Unable to call web api PUT method

[System.Web.Http.Route("{id}")]
    [System.Web.Http.HttpPut]
    public async Task<ComplaintVM> Put(int id,int? employeeId)
    {
        var obj = _resolver.GetService<Complaint>();
        obj.FranchiseId = 1;
        obj.Id = id;
        await obj.GetDetailAsyc();
        obj.EmployeeId = employeeId;
        await obj.AllocateAndManageCallAsyc();
        return obj.EntityToVM();
    }

This is put method with [System.Web.Http.RoutePrefix("api/app/complaint")]

so when i call my method with a PUT request i get the following error "message: "The requested resource does not support http method 'PUT'.".

but when i make the same call when the method does not have int? employeeId parameter. The call happens fine.

I am passing the employeeId as a json formatted request. I am using fiddler to test the code

Aucun commentaire:

Enregistrer un commentaire