aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/WebDataHandler.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index 8bfabf183..5a0aab3e4 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -132,9 +132,9 @@ public class WebDataHandler extends BaseDataHandler {
AsyncHttpClient.BoundRequestBuilder requestBuilder = Context.getAsyncHttpClient().preparePost(url);
requestBuilder.setBodyEncoding(StandardCharsets.UTF_8.name());
- requestBuilder.addHeader("Content-Type", getContentType());
+ requestBuilder.addHeader("Content-Type", "application/json; charset=utf-8");
- setContent(position, requestBuilder);
+ requestBuilder.setBody(prepareJsonPayload(position));
requestBuilder.execute();
} else {
@@ -143,14 +143,6 @@ public class WebDataHandler extends BaseDataHandler {
return position;
}
- protected String getContentType() {
- return "application/json; charset=utf-8";
- }
-
- protected void setContent(Position position, AsyncHttpClient.BoundRequestBuilder requestBuilder) {
- requestBuilder.setBody(prepareJsonPayload(position));
- }
-
protected String prepareJsonPayload(Position position) {
Map<String, Object> data = new HashMap<>();