[
https://issues.apache.org/jira/browse/QUARKS-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15289688#comment-15289688
]
ASF GitHub Bot commented on QUARKS-96:
--------------------------------------
Github user dlaboss commented on a diff in the pull request:
https://github.com/apache/incubator-quarks/pull/106#discussion_r63770797
--- Diff:
connectors/http/src/test/java/quarks/test/connectors/http/HttpTest.java ---
@@ -170,4 +288,80 @@ public void testJsonGet() throws Exception {
assertTrue(endCondition.getResult().toString(),
endCondition.valid());
}
+
+ @Test
+ public void testJsonPost() throws Exception {
+
+ DirectProvider ep = new DirectProvider();
+
+ Topology topology = ep.newTopology();
+
+ final String url = "http://httpbin.org/post";
+
+ JsonObject body = new JsonObject();
+ body.addProperty("foo", "abc");
+ body.addProperty("bar", 42);
+
+ TStream<JsonObject> stream =
topology.collection(Arrays.asList(body));
+ TStream<JsonObject> rc = HttpStreams.postJson(
+ stream, HttpClients::noAuthentication, t -> url,
+ t -> body);
--- End diff --
should be `t -> t`
> Add an HTTP POST utility method.
> --------------------------------
>
> Key: QUARKS-96
> URL: https://issues.apache.org/jira/browse/QUARKS-96
> Project: Quarks
> Issue Type: Improvement
> Components: Connectors
> Reporter: Daniel John Debrunner
> Assignee: Dale LaBossiere
> Labels: newbie
>
> HTTPStreams.requests can support any type of request but it would be useful
> to have a utility method for POST requests, similar to getJson - i.e., a
> postJson()
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)