/** * Create an HTTP DELETE request to send to the server at the default host and port. * @param requestURI the relative URI * @return an HTTP client request object */ public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> delete(String requestURI) { io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.delete(requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG); return ret; }
/** * Create an HTTP DELETE request to send to the server at the specified host and port. * @param port the port * @param host the host * @param requestURI the relative URI * @return an HTTP client request object */ public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> delete(int port, String host, String requestURI) { io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.delete(port, host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG); return ret; }
/** * Create an HTTP DELETE request to send to the server at the default host and port. * @param requestURI the relative URI * @return an HTTP client request object */ public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> delete(String requestURI) { io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.delete(requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG); return ret; }
/** * Create an HTTP DELETE request to send to the server at the specified host and default port. * @param host the host * @param requestURI the relative URI * @return an HTTP client request object */ public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> delete(String host, String requestURI) { io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.delete(host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG); return ret; }
/** * Create an HTTP DELETE request to send to the server at the specified host and port. * @param port the port * @param host the host * @param requestURI the relative URI * @return an HTTP client request object */ public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> delete(int port, String host, String requestURI) { io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.delete(port, host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG); return ret; }
/** * Create an HTTP DELETE request to send to the server at the specified host and default port. * @param host the host * @param requestURI the relative URI * @return an HTTP client request object */ public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> delete(String host, String requestURI) { io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.delete(host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG); return ret; }
/** * Deletes a secret from `path`. * * @param path the path * @param resultHandler the callback invoked with the result */ public void delete(String path, Handler<AsyncResult<Void>> resultHandler) { Objects.requireNonNull(resultHandler); client.delete("/v1/" + Objects.requireNonNull(path)) .putHeader(TOKEN_HEADER, Objects.requireNonNull(getToken(), "The token must be set")) .send(ar -> { if (ar.failed()) { resultHandler.handle(VaultException.toFailure("Unable to access the Vault", ar.cause())); return; } HttpResponse<Buffer> response = ar.result(); if (response.statusCode() != 204) { resultHandler.handle(VaultException.toFailure(response.statusMessage(), response.statusCode(), response.bodyAsString())); } else { resultHandler.handle(Future.succeededFuture()); } }); }
/** * Stop messaging client and get all informations about them (stdOut, stdErr, code, isRunning) * * @param uuid client id * @return * @throws InterruptedException * @throws ExecutionException * @throws TimeoutException */ public JsonObject stopClient(String uuid) throws InterruptedException, ExecutionException, TimeoutException { CompletableFuture<JsonObject> responsePromise = new CompletableFuture<>(); JsonObject request = new JsonObject(); request.put("id", uuid); client.delete(endpoint.getPort(), endpoint.getHost(), "") .as(BodyCodec.jsonObject()) .timeout(120000) .sendJson(request, ar -> responseHandler(ar, responsePromise, HttpURLConnection.HTTP_OK, "Error removing messaging clients")); return responsePromise.get(150000, TimeUnit.SECONDS); }
private void testRequest(HttpMethod method) throws Exception { testRequest(client -> { switch (method) { case GET: return client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath"); case HEAD: return client.head(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath"); case DELETE: return client.delete(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath"); default: fail("Invalid HTTP method"); return null; } }, req -> assertEquals(method, req.method())); }