/** * Configure the request to perform basic access authentication. * <p> * In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', * where credentials is the base64 encoding of id and password joined by a colon. * </p> * @param id the id * @param password the password * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.client.HttpRequest<T> basicAuthentication(String id, String password) { delegate.basicAuthentication(id, password); return this; }
/** * Configure the request to perform basic access authentication. * <p> * In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', * where credentials is the base64 encoding of id and password joined by a colon. * </p> * @param id the id * @param password the password * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.client.HttpRequest<T> basicAuthentication(String id, String password) { delegate.basicAuthentication(id, password); return this; }
/** * Configure the request to perform basic access authentication. * <p> * In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', * where credentials is the base64 encoding of id and password joined by a colon. * </p> * @param id the id * @param password the password * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.client.HttpRequest<T> basicAuthentication(io.vertx.rxjava.core.buffer.Buffer id, io.vertx.rxjava.core.buffer.Buffer password) { delegate.basicAuthentication(id.getDelegate(), password.getDelegate()); return this; }
/** * Configure the request to perform basic access authentication. * <p> * In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', * where credentials is the base64 encoding of id and password joined by a colon. * </p> * @param id the id * @param password the password * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.client.HttpRequest<T> basicAuthentication(io.vertx.rxjava.core.buffer.Buffer id, io.vertx.rxjava.core.buffer.Buffer password) { delegate.basicAuthentication(id.getDelegate(), password.getDelegate()); return this; }
@Test public void testBasicAuthentication() throws Exception { testRequest( client -> client.get("somehost", "somepath").basicAuthentication("ém$¨=!$€", "&@#§$*éà#\"'"), req -> { String auth = req.headers().get(HttpHeaders.AUTHORIZATION); assertEquals("Was expecting authorization header to contain a basic authentication string", "Basic w6ltJMKoPSEk4oKsLSZAI8KnJCrDqcOgIyIn", auth); } ); }