Nest: Call external API

Created on 19 Mar 2018  路  6Comments  路  Source: nestjs/nest

In a javascript backend i usually use 'request' package to do hhtp calls to another external web service (REST Json).

In a Nestjs solution what's the best practice?

Thanks

question 馃檶

Most helpful comment

It would be great if you add a sample about it in site documentation

All 6 comments

I recommending using Axios but since v5.x * _which will be released soon_ * you could use HttpModule

HttpModule is available already (in 4.6.6 as well). You can import it from @nestjs/common/http. This module exposes HttpService. 馃檪

It would be great if you add a sample about it in site documentation

@RezaRahmati Just add HttpModule to your imports in your app.module.ts and then inject HttpService into your constructor.

the syntax for HTTP get method because I m getting no response can anyone provide me

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yanshuf0 picture yanshuf0  路  3Comments

marshall007 picture marshall007  路  3Comments

KamGor picture KamGor  路  3Comments

anyx picture anyx  路  3Comments

janckerchen picture janckerchen  路  3Comments