diff --git a/README.md b/README.md index de607b0..1fdc44f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Connect tools is Maven ## Requirements * Java 1.8 -* Gradle 3 +* Gradle 5 Kafka Connect CLI ================= diff --git a/src/main/scala/com/datamountaineer/connect/tools/RestKafkaConnectApi.scala b/src/main/scala/com/datamountaineer/connect/tools/RestKafkaConnectApi.scala index 4971ddd..3addfa3 100644 --- a/src/main/scala/com/datamountaineer/connect/tools/RestKafkaConnectApi.scala +++ b/src/main/scala/com/datamountaineer/connect/tools/RestKafkaConnectApi.scala @@ -34,7 +34,10 @@ object ScalajHttpClient extends HttpClient { */ def request(url: java.net.URI, method: String, headers: Seq[(String, String)], reqBody: Option[String]): Try[(Int, Option[String])] = { try { - val r = Http(url.toString).headers(headers) + val r = (Option(url.getUserInfo).getOrElse("").split(":") match { + case Array(user, password) => Http(url.toString).auth(user, password) + case _ => Http(url.toString) + }).headers(headers) (reqBody match { case Some(body) => r.postData(body) case None => r