Data Manipulation Panel Plugin - How to show a specific HTTP Response Header value in notification message

I followed vitPinchuk’s guide here and it worked :star_struck:

It was necessary to set Access-Control-Expose-Headers (Node-RED example):

node-red

And access necessary header via context.panel.response.headers.get() in Custom Code of Update Request section:

if (response && response.ok) {
  notifySuccess(['Test command', 'Success']);
  locationService.reload();
} else {
  notifyError(['Test command', 'Error: ' + context.panel.response.headers.get('errmsg')]);
}

Result:

Error

2 Likes