{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by Domnic Benedict · Oct 12, 2020 at 10:19 AM · 43 Views node.jsservicecalloutlocaltargetconnection

How to configure a POST call for a NodeJS Target

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

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0
Best Answer

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

Comment
Add comment Show 3 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Domnic Benedict · Oct 12, 2020 at 11:26 AM 0
Link

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

avatar image Priyadarshi Ajitav Jena Domnic Benedict · Oct 12, 2020 at 11:32 AM 1
Link

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.

avatar image Domnic Benedict Priyadarshi Ajitav Jena · Oct 26, 2020 at 12:15 AM 0
Link

Thank you.. that solved the issue.

Follow this Question

Answers Answers and Comments

92 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

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

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges