How to execute curl command in API proxy

Not applicable

I'm using NodeJs API proxy for our service, now I'd like to execute curl command inside the api proxy to check whether the communication is happening between api proxy & our protected target.


Is their anyway to do this? FYI In Error Trace option, I'm seeing execution code as "200", however response body is always blank.

0 3 1,066
3 REPLIES 3

Not applicable

Assuming that your backend is surfaced as an HTTP endpoint. You could leverage http, request or even curlrequest npm modules to make an http call. Not sure if I understand what you're trying to achieve though.

I've used request in my API proxy, but I'm getting "ERROR: connect ECONNREFUSED" as a backend service response. What I want to do is simply executing curl command from apigee server(server which sends request to my backend server) to understand whether api can talk to my internal service or not

How are you planning to leverage cURL? if it's for troubleshooting purposes, you should be able to get the same data with those modules. Also this may sound obvious, but if you can make sure you can hit your API with Postman or cURL from your laptop connected to an external network, then you should be able to hit it from Apigee. If not, you'll need to whitelist Apigee through other methods. But first, try the steps above.