REST Call with Binary Response

Steps

  1. Create a project rest_call_binary_project.
  2. Then create a JavaScript service named get_call_binary.js.
  3. Within the service code, enter the following content:

GET Call


var client = require("http/v4/client");
var response = require("http/v4/response");

var httpResponse = client.get("https://raw.githubusercontent.com/eclipse/dirigible/master/NOTICE.txt", {
	binary: true
});

response.println(httpResponse.statusMessage);
response.println(JSON.stringify(httpResponse.data));
response.flush();
response.close();


For more information, see the API documentation.

Edit