Fixed examples that docgen is unable to translate
+/*
+ * Copyright 2018 Red Hat, Inc.
+ *
+ * Red Hat licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
package examples;
import io.vertx.core.MultiMap;
@@ -75,7 +91,16 @@ public class WebClientExamples {
client
.get(8080, "myserver.mycompany.com", "/some-uri")
.addQueryParam("param", "param_value")
- .send(ar -> {});
+ .send(ar -> {
+ if (ar.succeeded()) {
+ // Obtain response
+ HttpResponse<Buffer> response = ar.result();
+
+ System.out.println("Received response with status code" + response.statusCode());
+ } else {
+ System.out.println("Something went wrong " + ar.cause().getMessage());
+ }
+ });
}
public void simpleGetWithInitialParams(WebClient client) {
@@ -178,7 +203,11 @@ public class WebClientExamples {
// When the stream len is unknown sendStream sends the file to the server using chunked transfer encoding
client
.post(8080, "myserver.mycompany.com", "/some-uri")
- .sendStream(stream, resp -> {});
+ .sendStream(stream, ar -> {
+ if (ar.succeeded()) {
+ // Ok
+ }
+ });
}
public void sendJsonObject(WebClient client) {
