How to be authenticated when taking the incoming data stream and post it to an HTTP endpoint?

I created a tick script to take the alert data and post it to an HTTP endpoint. The kapacitor log showed an authentication error (http return code 401):

ts=2023-07-20T19:45:32.162Z lvl=error msg=“POST returned non 2xx status code” service=kapacitor task_master=main task=Ping_vm_mobility-os node=http_post7 err=“{\n "message": "You must be authenticated.",\n "status": 401\n}\n” code=401

To configure authentication for HTTP API within my TICKscript, I use the .header() method to add custom headers (user ID/password) to the HTTP POST request. The tick script code associated with this is listed below. Note that “” is the user ID and its password is “Test00591”. They are added to ‘.header()’ for authentication:

var trigger = data
.warn(lambda: (“value” >= warn_ppl AND “state_duration_ppl” >= 3) OR (“value2” >= warn_arm AND “state_duration_arm” >= 3))
.crit(lambda: (“value” >= crit_ppl AND “state_duration_ppl” >= 3) OR (“value2” >= crit_arm AND “state_duration_arm” >= 3))
.id(‘{{ index .Tags “url” }}/Ping_vm_mobility-os’)
.header(‘Authorization’, ‘’)

It looks like there is a problem when adding authentication information to HTTP POST header using ‘.header()’. What is the correct syntax/format in ‘.header()’ for this purpose? Or, how to configure authentication for HTTP API within my TICKscript?