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

Response not displayed in the API console

Hi Everyone, Could you please help me in the following issue?

I have created an API proxy using Route Rule as shown in below snippet.

<TargetEndpoint name=“Endpoint">
  <Description/> 
  <FaultRules/> 
  <PreFlow name="PreFlow">
    <Request/> <Response/>
  </PreFlow>
  <PostFlow name="PostFlow">
    <Request/> <Response/>
  </PostFlow>
  <Flows/>
  <HTTPTargetConnection>
    <Properties/>
    <URL>http://ankit9211-test.apigee.net/api/v1/</URL>
  </HTTPTargetConnection>
</TargetEndpoint>

and now am executing this end point using Javascript like as shown below,

var url = "http://ramesh9211-test.apigee.net/v1/orders/"+
  context.getVariable("orders.orderId" ) ;
print("helooooooooooooooorderId11111 * * " + url);


var data = httpClient.get(url);


if (data.isSuccess()) {
  var responseObj = data.getResponse().content.asJSON;
  print("helooooooooooooooo * * " +responseObj);
  context.setVariable("responseObj ", responseObj);


  if (responseObj.error) {
    throw new Error(responseObj.error_description);
  }
  print("helooooooooooooooo33333 * * ");
}
else if (data.isError()){
  throw new Error(data.getError());
}

so, while am trying to debug my API it is showing the response in Body but it is not displayed in the API Console,

Response received from target server Body {"subscriptionId":"366a192b7913b04c54574d18c28d46e6395428a","orderId":"36","storeId":"9"}

Please help regarding this issue if you have any solution,

Thanks in advance.

Solved Solved
0 4 3,133
1 ACCEPTED SOLUTION

Not applicable

Hello @VENKATA LAKSHMI KONDAPALLI,

Since you are using the print command, you would be able to see the data under the "Output from all Transactions" in Trace Window.

Does this help ?

View solution in original post

4 REPLIES 4
Top Solution Authors