I have encountered an issue where I am attempting to pass 3 parameters (2 types and one string) but they are showing up as null on the server side.
Below is my service:
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json '
})
};
let body = {
auditId: auditId,
rolId: this.permisoService.currentUserRolValue.rolId,
valores: JSON.stringify(valores),
}
return this.http.post<any>(this._saveURL, body, httpOptions).pipe(
map(res => { return res; }),
catchError(this.handleError)
);
}
And here is what I have on the server side:
[HttpPost, Route("AuditMail/Save"), Produces("application/json")]
public async Task<IActionResult> Save([FromBody] int auditId, int rolId , String valores)
{
return Json(await _repository.Save(auditId, rolId, valores));
}
I have attempted changing the content-type to text/plain and removing [FromBody] with no success.
Any help would be greatly appreciated. Thank you.