Is there anybody can help me to solve this "httpPostJson()" problem?

I’m trying to write a SmartApp to send the state of a device to a server (my VPS). The code is as follows:

preferences {
section(“Collect the motion data:”) {
input “motion_sensor”, “capability.motionSensor”, required: true

def installed() {
log.debug “Installed with settings: ${settings}”



def updated() {
log.debug “Updated with settings: ${settings}”



def initialize() {
// TODO: subscribe to attributes, devices, locations, etc.

subscribe(motion_sensor, "", postData)


def postData(evt) {
def params = [
uri: “”,
// or uri: “

try {
	httpPostJson(params) {
    log.debug "Do nothing on the response."
} catch (e) {
	log.debug "something went wrong: $e"

// TODO: implement event handlers

This SmartApp is supposed to send some data to a remote server once it is triggered by a “Motion” event.

But once I triggered the motion sensor, it outputs some debug information:

“something went wrong: java.lang.reflect.UndeclaredThrowableException”

Is there anybody can help me? Thank you very much.

I’ve solved this: “” --> “

How stupid I am.