OVERVIEW:
My apigee proxy works when I call it from postman, but when I call it from smartDocs the browser window shows “An internal error has occurred. Please retry your request.” Chrome developer console says the root cause is 502 bad gateway > Uncaught TypeError: Cannot read property 'length'
/products - returns all products, size = 13.61 MB, response takes 24 sec
/products?skus=1,2,3 – returns a much smaller subset of products
HYPOTHESIS: The response from /products is too big for smartDocs to handle
DETAILS:
Action 1: start Trace and call /products from smartDocs
Observation 1:
XMLHttpRequest cannot load https://apiconsole-prod.apigee.net/smartdocs/v1/sendrequest?targeturl={my-target-url}. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://dev-{my-org}.devportal.apigee.com' is therefore not allowed access. The response had HTTP status code 502.
Action 2: Enable CORS with chrome plugin (NOTE: The other calls worked without enabling the CORS plugin)
Observation 2:
GET https://apiconsole-prod.apigee.net/smartdocs/v1/sendrequest?targeturl={my-target-url} 502 (Bad Gateway)
Bad Gateway
Uncaught TypeError: Cannot read property 'length'
Thanks!