Search in sources :

Example 1 with HttpRequest

use of io.vertx.ext.web.client.HttpRequest in project vertx-web by vert-x3.

the class ApiClient method headerSimpleExplodeArray.

/**
 * Call header_simple_explode_array with empty body.
 * @param color Parameter color inside header
 * @param handler The handler for the asynchronous request
 */
public void headerSimpleExplodeArray(List<Object> color, Handler<AsyncResult<HttpResponse>> handler) {
    // Check required params
    if (color == null)
        throw new RuntimeException("Missing parameter color");
    // Generate the uri
    String uri = "/header/simple/explode/array";
    HttpRequest request = client.get(uri);
    MultiMap requestCookies = MultiMap.caseInsensitiveMultiMap();
    if (color != null)
        this.addHeaderArraySimpleExplode("color", color, request);
    this.renderAndAttachCookieHeader(request, requestCookies);
    request.send(handler);
}
Also used : HttpRequest(io.vertx.ext.web.client.HttpRequest) MultiMap(io.vertx.core.MultiMap)

Example 2 with HttpRequest

use of io.vertx.ext.web.client.HttpRequest in project vertx-web by vert-x3.

the class ApiClient method querySpaceDelimitedNoexplodeObject.

/**
 * Call query_spaceDelimited_noexplode_object with empty body.
 * @param color Parameter color inside query
 * @param handler The handler for the asynchronous request
 */
public void querySpaceDelimitedNoexplodeObject(Map<String, Object> color, Handler<AsyncResult<HttpResponse>> handler) {
    // Check required params
    if (color == null)
        throw new RuntimeException("Missing parameter color");
    // Generate the uri
    String uri = "/query/spaceDelimited/noexplode/object";
    HttpRequest request = client.get(uri);
    MultiMap requestCookies = MultiMap.caseInsensitiveMultiMap();
    if (color != null)
        this.addQueryObjectSpaceDelimited("color", color, request);
    this.renderAndAttachCookieHeader(request, requestCookies);
    request.send(handler);
}
Also used : HttpRequest(io.vertx.ext.web.client.HttpRequest) MultiMap(io.vertx.core.MultiMap)

Example 3 with HttpRequest

use of io.vertx.ext.web.client.HttpRequest in project vertx-web by vert-x3.

the class ApiClient method pathMatrixExplodeArray.

/**
 * Call path_matrix_explode_array with empty body.
 * @param color Parameter color inside path
 * @param handler The handler for the asynchronous request
 */
public void pathMatrixExplodeArray(List<Object> color, Handler<AsyncResult<HttpResponse>> handler) {
    // Check required params
    if (color == null)
        throw new RuntimeException("Missing parameter color in path");
    // Generate the uri
    String uri = "/path/matrix/explode/array/{;color*}";
    // Remove * . ; ? from url template
    uri = uri.replaceAll("\\{{1}([.;?*+]*([^\\{\\}.;?*+]+)[^\\}]*)\\}{1}", "{$2}");
    uri = uri.replace("{color}", this.renderPathArrayMatrixExplode("color", color));
    HttpRequest request = client.get(uri);
    MultiMap requestCookies = MultiMap.caseInsensitiveMultiMap();
    this.renderAndAttachCookieHeader(request, requestCookies);
    request.send(handler);
}
Also used : HttpRequest(io.vertx.ext.web.client.HttpRequest) MultiMap(io.vertx.core.MultiMap)

Example 4 with HttpRequest

use of io.vertx.ext.web.client.HttpRequest in project vertx-web by vert-x3.

the class ApiClient method headerSimpleNoexplodeString.

/**
 * Call header_simple_noexplode_string with empty body.
 * @param color Parameter color inside header
 * @param handler The handler for the asynchronous request
 */
public void headerSimpleNoexplodeString(String color, Handler<AsyncResult<HttpResponse>> handler) {
    // Check required params
    if (color == null)
        throw new RuntimeException("Missing parameter color");
    // Generate the uri
    String uri = "/header/simple/noexplode/string";
    HttpRequest request = client.get(uri);
    MultiMap requestCookies = MultiMap.caseInsensitiveMultiMap();
    if (color != null)
        this.addHeaderParam("color", color, request);
    this.renderAndAttachCookieHeader(request, requestCookies);
    request.send(handler);
}
Also used : HttpRequest(io.vertx.ext.web.client.HttpRequest) MultiMap(io.vertx.core.MultiMap)

Example 5 with HttpRequest

use of io.vertx.ext.web.client.HttpRequest in project vertx-web by vert-x3.

the class ApiClient method pathMatrixNoexplodeArray.

/**
 * Call path_matrix_noexplode_array with empty body.
 * @param color Parameter color inside path
 * @param handler The handler for the asynchronous request
 */
public void pathMatrixNoexplodeArray(List<Object> color, Handler<AsyncResult<HttpResponse>> handler) {
    // Check required params
    if (color == null)
        throw new RuntimeException("Missing parameter color in path");
    // Generate the uri
    String uri = "/path/matrix/noexplode/array/{;color}";
    // Remove * . ; ? from url template
    uri = uri.replaceAll("\\{{1}([.;?*+]*([^\\{\\}.;?*+]+)[^\\}]*)\\}{1}", "{$2}");
    uri = uri.replace("{color}", this.renderPathArrayMatrix("color", color));
    HttpRequest request = client.get(uri);
    MultiMap requestCookies = MultiMap.caseInsensitiveMultiMap();
    this.renderAndAttachCookieHeader(request, requestCookies);
    request.send(handler);
}
Also used : HttpRequest(io.vertx.ext.web.client.HttpRequest) MultiMap(io.vertx.core.MultiMap)

Aggregations

MultiMap (io.vertx.core.MultiMap)52 HttpRequest (io.vertx.ext.web.client.HttpRequest)52 Truth.assertThat (com.google.common.truth.Truth.assertThat)4 MqttQoS (io.netty.handler.codec.mqtt.MqttQoS)4 Span (io.opentracing.Span)4 AsyncResult (io.vertx.core.AsyncResult)4 Future (io.vertx.core.Future)4 Handler (io.vertx.core.Handler)4 Buffer (io.vertx.core.buffer.Buffer)4 HttpHeaders (io.vertx.core.http.HttpHeaders)4 HttpResponse (io.vertx.ext.web.client.HttpResponse)4 WebClient (io.vertx.ext.web.client.WebClient)4 VertxExtension (io.vertx.junit5.VertxExtension)4 VertxTestContext (io.vertx.junit5.VertxTestContext)4 MqttEndpoint (io.vertx.mqtt.MqttEndpoint)4 MqttPublishMessage (io.vertx.mqtt.messages.MqttPublishMessage)4 HttpURLConnection (java.net.HttpURLConnection)4 URLEncoder (java.net.URLEncoder)4 StandardCharsets (java.nio.charset.StandardCharsets)4 Map (java.util.Map)4