I have this function in my Web api 2:
// POST: Análise CR
[HttpPost]
[Route("api/insertanaliseCR/{NumSerie_app}/{amostrador}/{Documento}")]
[ResponseType(typeof(object))]
public async Task<IHttpActionResult> insertanaliseCR(string NumSerie_app, string amostrador, string Documento, TBAnaliseCR analiseCR, TBAnaliseFQ analiseFQ)
{
[...] //some code
}
Its everything ok in Visual Studio!
So I want to call it in my angularjs service:
//POST analiseCR
EmpApi.insertanaliseCR = function (analiseCR, analiseFQ, NumSerie_app, amostrador, Documento) {
return $http.post(urlBase + '/insertanaliseCR/' + NumSerie_app +
'/' + amostrador +
'/' + Documento,
analiseCR,
analiseFQ
);
}
EmpApi it my factory, i already declared it, and it's working.
But the connection between service angular and my web service is not working. Is there anything wrong in the way that I'm passing the params in angularjs?
Erros did I got:
Object { data: null, status: -1, headers: headersGetter/<(), config: Object, statusText: "" }
Object { Message: "An error has occurred.", ExceptionMessage: "Can't bind multiple parameters ('an…", ExceptionType: "System.InvalidOperationException", StackTrace: " at System.Web.Http.Controllers.H…" }
Can't bind multiple parameters ('analiseCR' and 'analiseFQ') to the request's content.