Why a curl command works but a similar .Q.hp command fails when sending alerts to TEAMS from KDB

Viewed 57

I have this curl command to send alerts to TEAMS and it works fine:

system"curl -H 'Content-Type: application/json' -d '{\"text\" : \"Hello World\"}' https://<link to webhook>"

I wanted to use .Q.hp instead just to keep things in KDB and I constructed this one :

.Q.hp["https://<link to webhook>";.h.ty`json] .j.j enlist[`text]!enlist"Hello World"

and I get the following error :

"<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
"

Any ideas why the .Q.hp is not working?

0 Answers
Related