1
I have a request made in Angular for C#. However I don’t know how to receive the data in My API In C#.
getWithFilters(filter: any) {
let parametros: any = {
razaoSocial: filter.razaoSocial,
cnpj: filter.cnpjcpf,
telefone: filter.telefone
}
return this.http
.get(this.UrlService + '/Clientes', parametros)
.map((res: any) => res.data)
.catch((super.serviceError));
}
So I do the request, however in C# How do I receive these parameters?
Thank you in advance. Lucas.
You can create a Viewmodel reflecting your object for the API to serialize/deserialize in C# to receive and respond the object to your client. How is your API?
– Leandro Angelo
Angelo, I got what I wanted, however I stopped using GET and started sending via POST. As you know in GET we have no way to send a body. Anyway, thanks for your help.
– Lucas Brogni
Ahh that was very important, I hadn’t noticed.
– Leandro Angelo
Yes yes, I ended up forgetting at the time too. Anyway, thank you.
– Lucas Brogni
It would be nice if you put your solution as an answer so that this question can help other users in the future.
– Leandro Angelo
I’ll do that... thanks for the idea.
– Lucas Brogni