import { Injectable , HttpService } from '@nestjs/common' ; interface Student { name : string ; grades : number [ ] ; } @ Injectable ( ) export class ApiService { constructor ( private http ) { } async getStudent ( firstName , lastName ) { const url = `....../get-student?firstName=${ firstName }&lastName=${ lastName }` ; const response = await this . http . get ( url ) . toPromise ( ) ; return response . data ; } }