Welcome! Log In Create A New Profile

Advanced

Re: NJS - API Calls

Dmitry Volyntsev
June 03, 2019 01:40PM
On 03.06.2019 20:27, naidile.pn wrote:
> Hi Team,
>
> Can you please let me know how to make external API calls within the JS
> method.


Hi Naidile,

what do you mean by external API calls?


> I actually want to make API calls and modify the request before proxy
> passing th e request to a up stream server.


It is considered to a bad practice to modify client request directly.
Instead you can create a subrequest
(http://nginx.org/en/docs/njs/reference.html#subrequest) and modify it
in a sublocation. See as an example
https://github.com/xeioex/njs-examples#subrequests-join

>
> Thanks,
> Naidile
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

NJS - API Calls

naidile.pn 307 June 03, 2019 01:30PM

Re: NJS - API Calls

Dmitry Volyntsev 156 June 03, 2019 01:40PM

Re: NJS - API Calls

naidile.pn 144 June 03, 2019 01:46PM

Re: NJS - API Calls

naidile.pn 225 June 03, 2019 01:48PM

Re: NJS - API Calls

Dmitry Volyntsev 139 June 03, 2019 02:04PM

Re: NJS - API Calls

naidile.pn 149 June 03, 2019 02:10PM

Re: NJS - API Calls

Dmitry Volyntsev 137 June 03, 2019 02:16PM

Re: NJS - API Calls

naidile.pn 139 June 03, 2019 02:22PM

Re: NJS - API Calls

naidile.pn 138 June 04, 2019 05:14AM

Re: NJS - API Calls

Dmitry Volyntsev 153 June 04, 2019 05:32AM

Re: NJS - API Calls

Dmitry Volyntsev 177 June 04, 2019 08:56AM

Re: NJS - API Calls

naidile.pn 183 June 04, 2019 02:46PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 225
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready