NestJS · Junior · Question 73 of 75
How do you call an external HTTP API from a Nest service in the Nest way?
- ✓Correct answer: Inject
HttpServicefrom@nestjs/axios(or usefetch), configured throughHttpModule - 2Nest blocks outgoing HTTP requests
- 3Only through a microservice transport
Explanation
HttpService returns Observables; firstValueFrom() turns them into promises. Plain fetch works too. Always set timeouts.