additional headers with connection in invokeURL not working
Hi all,
I'm currently implementing an extension that makes requests to our service outside of SDP. Due to some internal logic usage, we need to append an extra header.
Currently I'm testing on my custom functions. Below is my code snippet:
- headerMap = Map();
headerMap.put("Content-Type", "application/json");
- headerMap.put("X-TM-User-Agent", "TMV1ServiceDeskPlusTicketingConnector/1.0.0");
-
try
{ - response = invokeurl
[
- url : fullApiUrl
- type : PATCH
- body : jsonBody
- headers : headerMap
- detailed : true
- connection : "tm_visionone_api"
- ];
But found no such headers added in our kibana. We also tested with Jira (it can achieve that), the "-" is the ones from Service Desk Plus cloud.
I also tried this but got the same result:
- response = invokeurl
[
-
url : fullApiUrl
- type : PATCH
- body : jsonBody
- headers : {"Content-Type":"application/json", "X-TM-User-Agent":"TMV1ServiceDeskPlusTicketingConnector/1.0.0"}
- detailed : true
- connection : "tm_visionone_api"
- ];
And this, to add an additional header in my connection, but got the same results.
Is there a way to do so in custom functions "and" custom widgets?
Thanks in advance!