When I wish to make an appointment by query params
, I use the following code.
getMedicos(especialidade): Observable<Medico[]> {
return this.http.get<Medico[]>(this.medicoUrl, {
params: {
'especialidade': especialidade
}
})
.pipe(
catchError(this.handleError<Medico[]>('getMedicos', []))
)
}
In my example I am consulting the endpoint:
private medicoUrl = 'http://localhost:8000/medicos/';
But the final endpoint running by the application will be:
http://localhost:8000/medicos/?especialidade=clinico
This way I imagine that in your case it would be something like 3 query params
, soon in your example would be something like:
FindByRdo(numero: number, ano: number, objeto: Objeto) {
return this.http.get(`${this.endpoint}`, {
params: {
'numero':numero,
'ano': ano,
'objeto': o });
}
Note that in my example I used the http method
GET. It wasn’t clear which was the http method
that used.
Imagine that you would like to help someone, but only receive this information. What would be your suggestion?
– Danizavtz