%ODBCField2% in HTTP post request inserts \

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
totte
Posts: 55
Joined: Wed May 30, 2007 3:40 am

%ODBCField2% in HTTP post request inserts \

Post by totte »

Hi

I have an ODBC test returning 2 varchars, I use the variable %ODBCField2% in an http POST alert profile

The reply value in hostmonitor is {"user":"kalle"}. When using this in the alertprofile to post to the api {\"user\":\"kalle\"} is sent.


//t
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I assume you set "content-type: application/json" line in HTTP header?
Then HostMonitor translates variable value according to JSON encoding rules. If your database reruns JSON compatible strings, I would suggest to remove such HTTP header.

Regards
Alex
totte
Posts: 55
Joined: Wed May 30, 2007 3:40 am

Post by totte »

Hi,

But then i get html tags like %7B%22user%22%3A%22kalle%20johansson%22%7D


/t
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

We can add switch, some HTTP header like "hmvars: text", as "do not encode values" indicator.
Please contact support (by e-mail) in order to receive update.

Regards
Alex
Post Reply