I am using a JS Callout in my proxy to get a PNG image and am running into the following issues -
1) When I use https, I get the SSL error - Received fatal alert: handshake_failure
2) With http, I get a response but it is the raw PNG data. If I make the request in Postman, I get the image rendered properly. I think it may be an encoding issue when making the request via Apigee. Is there a JS workaround used for callouts in Apigee?
Here's my current code -
var headers = {'Accept':'image/png'}; var req =newRequest("https://tile2.aerisapi.com/credentials/current_temps/500x500/40/-105/10/0.png",'GET',headers); var exchange = httpClient.send(req); exchange.waitForComplete(); var response = exchange.getResponse(); if (exchange.isSuccess()) { var responseObject = exchange.getResponse(); print(responseObject); context.setVariable('awhere.imageResponse',responseObject.content); }else{ print(exchange.getError()); }
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |