I think the HTTP/s block only returns the response body. Is there a way to get the response header? If not do you have a suggestion on what to do about the rate limit issue?
It is possible with custom JS code injected into the logic. Here’s an example:
The Custom Code block has the following:
var request = new XMLHttpRequest();
return new Promise(function(resolve, reject) {
var headerMap = {};
request.open("GET", "https://quotes.rest/qod?language=en", true);
request.onreadystatechange = function() {
if (request.readyState == this.DONE) {
console.log( request.status);
if (request.status >= 200 && request.status < 300) {
resolve({responseText:request.responseText, headers:headerMap});
}
else {
reject("Error, status code = " + request.status)
}
}
if(this.readyState == this.HEADERS_RECEIVED) {
// Get the raw header string
var headers = request.getAllResponseHeaders();
// Convert the header string into an array
// of individual headers
var arr = headers.trim().split(/[\r\n]+/);
// Create a map of header names to values
arr.forEach(function (line) {
var parts = line.split(': ');
var header = parts.shift();
var value = parts.join(': ');
headerMap[header] = value;
});
}
}
request.send();
})
The sample code above runs a GET operation. You’d need to modify the code to use the URL of your external service with the required request headers and body.