httpPostJson

Guys
I'm porting over an app from ST and have the following command which is not doing anything

 	try {
 		httpPostJson(params) { resp ->
 			log.debug "Received Response: ${resp.status}"
 		}
 	} catch (e) {
		log.debug "Something went wrong: $e"
 	}

Is there an alternative to httpPostJson(params) or am I missing something stupid?

I'm trying to send data to a php response file on a webserver

There is nothing in logging to indicate where it's going wrong but I'm not getting the response from the php

Andy

You should look at @krlaframboiseā€™s other hub event pusher app as an example. It sends a Json string to ST:
https://raw.githubusercontent.com/krlaframboise/OtherHub2/master/apps/krlaframboise/other-hub-event-pusher.src/other-hub-event-pusher.groovy

That function starts on line 254

httpPostJson() method was added in release 1.1.2

2 Likes

Thanks Chuck

Andy

Ok @chuck.schwer why is httpPostJson not documented ?

Presented without comment.

https://docs.hubitat.com/index.php?title=Common_Methods_Object#httpPostJson

1 Like