Repository: incubator-edgent Updated Branches: refs/heads/master cc405cc6c -> c9d149f80
[Edgent-331] fix HttpConnector for MSWin Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/c9d149f8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/c9d149f8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/c9d149f8 Branch: refs/heads/master Commit: c9d149f80de728d15cd740147291f4c3531451f3 Parents: cc405cc Author: Dale LaBossiere <[email protected]> Authored: Thu Dec 29 14:19:17 2016 -0500 Committer: Dale LaBossiere <[email protected]> Committed: Thu Dec 29 14:19:17 2016 -0500 ---------------------------------------------------------------------- .../java/org/apache/edgent/connectors/http/HttpStreams.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c9d149f8/connectors/http/src/main/java/org/apache/edgent/connectors/http/HttpStreams.java ---------------------------------------------------------------------- diff --git a/connectors/http/src/main/java/org/apache/edgent/connectors/http/HttpStreams.java b/connectors/http/src/main/java/org/apache/edgent/connectors/http/HttpStreams.java index 58cb766..97c81a0 100644 --- a/connectors/http/src/main/java/org/apache/edgent/connectors/http/HttpStreams.java +++ b/connectors/http/src/main/java/org/apache/edgent/connectors/http/HttpStreams.java @@ -19,6 +19,8 @@ under the License. package org.apache.edgent.connectors.http; +import java.nio.charset.StandardCharsets; + import org.apache.edgent.connectors.http.runtime.HttpRequester; import org.apache.edgent.function.BiFunction; import org.apache.edgent.function.Function; @@ -178,7 +180,7 @@ public class HttpStreams { return HttpStreams.<JsonObject, JsonObject> requestsWithBody(stream, clientCreator, t -> HttpPost.METHOD_NAME, uri, - t -> new ByteArrayEntity(body.apply(t).toString().getBytes()), + t -> new ByteArrayEntity(body.apply(t).toString().getBytes(StandardCharsets.UTF_8)), HttpResponders.json()); } @@ -225,7 +227,7 @@ public class HttpStreams { UnaryOperator<JsonObject> body) { return HttpStreams.<JsonObject, JsonObject> requestsWithBody(stream, clientCreator, t -> HttpPut.METHOD_NAME, uri, - t -> new ByteArrayEntity(body.apply(t).toString().getBytes()), + t -> new ByteArrayEntity(body.apply(t).toString().getBytes(StandardCharsets.UTF_8)), HttpResponders.json()); }
