Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Passing parameter in nodejs hosted target

I have used a nodejs script which parses through proxy in a orge and return the virtual host associated with the proxy. That script uses parameter like username, password, org etc as input. I want to deploy the script as nodejs hosted target in apigee. How i can pass those parameters in nodejs hosted target 

@dino 

Solved Solved
0 5 432
1 ACCEPTED SOLUTION

You can pass parameters to a Hosted Target in any of these ways: 

  • query parameters
  • form parameters (application/x-www-form-urlencoded) 
  • headers
  • path segments (eg /inquire/ORGNAME/ENVNAME/PROXY
  • Parameters encoded in a payload (like XML or JSON)

I guess the function of the script is sort of independent of the options for how to submit parameters to it. If it's a hosted target, it accepts a web request, and that means you can use any of the usual mechanisms for passing information or parameters into it.

I would caution you though, to take care with your plan.  From your phrase "parses through proxy in an org" ,  I am inferring that the script invokes the Apigee administrative API to collect that information.  And did you know that invoking the Admin API from within a proxy is an anti-pattern?  Be careful when you do this.

View solution in original post

5 REPLIES 5