title: Pass credentials while calling an API in Scala
body: <p>I'm trying to call a REST endpoint using HttpGet and pass user credentials.</p>
  
  <pre><code>var content = ""
  val httpClient : CloseableHttpClient = HttpClients.createDefault();
  val httpResponse = new HttpGet(url)
  httpResponse.addHeader(BasicScheme.authenticate(new UsernamePasswordCredentials(“uname”,”pwd”),”UTF-8", false))
  val response = httpClient.execute(httpResponse)
  val entity = httpResponse.getEntity()
  val inputStream = entity.getContent()
  content = fromInputStream(inputStream).getLines.mkString
  inputStream.close
  httpClient.getConnectionManager().shutdown()
  return content
  </code></pre>
  
  <p>Looks like BasicScheme is deprecated in "org.apache.http.impl.auth". Any pointers on how to move forward...
  Thanks in Advance.</p>