Hi,
I am pretty new to Apigee, but so far I enjoy the user friendliness of the app. I have a basic question. I am trying to do a Service call out (say getDataSCO). Sequentially I have to make a call to a NodeJS target (njsTarget) which is on another Proxy in the same org.
I was able to make a GET call to test if this works as I have a path to handle it. so i used
<LocalTargetConnection> <Path>/njsTarget/api/v1/solve</Path> </LocalTargetConnection>
This works for a GET call.
But, I need to pass on the response of the service callout (getDataSCO) as a request body in a POST method to my NodeJS target (njsTarget). How would I do that ? any suggestions please ?
Appreciate your help
Answer by Priyadarshi Ajitav Jena · Oct 12, 2020 at 11:18 AM
in your nodejs app
instead of
var express =require('express'); var app = express(); var fs =require("fs"); app.get('/Users',function(req, res){
do
app.post('/User',function(req, res){
In api call select POST in postman instead of GET
Hi,
It is not about how to write a POST call in NodeJS. I have that part done already. That is not the issue. My question was,
How do you configure the Target to pass a response from a previous ServiceCallout and make a Post call to the NodeJS app.
Thanks
ok, I assumed wrong. In that case, you can extract the service callout response, frame that to request payload using assign message policy and in the same assign message policy set the Verb tag to POST.
this will send the request as POST to the local target.
Thank you.. that solved the issue.
How Do i implement nodejs to the existing api proxy ? 2 Answers
How to callout to Node.js? 3 Answers
How to use the variable found in context of callout proxy in the calling proxy 1 Answer
is it possible to add native(!) node.js modules in apigee Edge? 1 Answer
NodeJs app runs fine locally - but dumps when deployed to Edge 2 Answers