diff options
author | Shinryuken <watertext@hotmail.it> | 2017-11-08 08:29:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-08 08:29:45 +0100 |
commit | 3363f82d05a02be3a035f984b1c7a365f327414f (patch) | |
tree | 28e49d3545e51f721f29b2e22a16c8e29ac318bd /src/org/traccar/notification/FormTypeEventForwarder.java | |
parent | e61584b14a2cfe0075964bdc7207adb55062d61b (diff) | |
download | traccar-server-3363f82d05a02be3a035f984b1c7a365f327414f.tar.gz traccar-server-3363f82d05a02be3a035f984b1c7a365f327414f.tar.bz2 traccar-server-3363f82d05a02be3a035f984b1c7a365f327414f.zip |
Default payload format as json, plaintext available as option
Diffstat (limited to 'src/org/traccar/notification/FormTypeEventForwarder.java')
-rw-r--r-- | src/org/traccar/notification/FormTypeEventForwarder.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/notification/FormTypeEventForwarder.java b/src/org/traccar/notification/FormTypeEventForwarder.java index d2c4aa691..e7564885d 100644 --- a/src/org/traccar/notification/FormTypeEventForwarder.java +++ b/src/org/traccar/notification/FormTypeEventForwarder.java @@ -17,8 +17,12 @@ public class FormTypeEventForwarder extends EventForwarder { if (!getAdditionalParams().equals("")) {
requestBuilder.setFormParams(splitParams(getAdditionalParams(), "="));
}
- requestBuilder.addFormParam(getPayloadParamName(),
- NotificationFormatter.formatForwarderMessage(event, position));
+
+ String payload = isUseTemplatesForPayload()
+ ? NotificationFormatter.formatForwarderMessage(event, position)
+ : prepareJsonPayload(event, position);
+
+ requestBuilder.addFormParam(getPayloadParamName(), payload);
}
}
|