Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Direct API POST method to another URL
Good morning, afternoon or night!! Dear all, I will need to be "listening" to an Access device that will be sending a Json in the POST Method. To do this, I created a (simple) API to do this monitoring and respond with a True or False.
Problem: I need to direct the Post to the Device API url, how can I do this?
[HttpPost]
public IActionResult EntradaAssociado(
[FromBody]AcessoAssociadoDto enviarAssociado
)
{
var associados = _context
.AssociadoDtos
.FirstOrDefault(associados => associados.Matricula == enviarAssociado.Matricula);
if (associados == null) return NotFound();
var associado = _mapper.Map<AssociadoDto>(associados);
return CreatedAtAction(nameof(CarregarAssociadoPorMatricula), new { _matricula = associado.Matricula }, associado);
}
Thank you very much in advanceAt first I created the code by "listening" to the post from my base, which works. Now I need you to listen to the URL that the controller will make available
Developer technologies | .NET | Other
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Developer technologies | ASP.NET Core | Other
A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.