title: How do I get an http response using Basic, Digest, & NTLM/WindowsIdentity?
body: <p>There are numerous answer to this (<a href="https://stackoverflow.com/questions/4008545/http-digest-authentication-with-httpurlconnection">one</a>, <a href="https://stackoverflow.com/questions/2152573/java-client-program-to-send-digest-authentication-request-using-httpclient-api">two</a>, <a href="https://stackoverflow.com/questions/17599339/apache-http-digest-authentication-using-java">three</a>) but they all use obsolete methods. For Java 1.7 and later what is the best way to request a resource over http when credentials need to be supplied for Basic, Digest, NTLM, and/or Windows Identity?</p>
  
  <p>Using an Apache library for this is fine.</p>
  
  <p>I know this is a repeat question, but the existing answer all appear to be using obsolete calls.</p>
  
  <p><strong>Update:</strong> This is for a library we have where a user can pass to us any URL and say it is any of the different authentication systems. This library is added to different applications by our users. So, it could be any service, used in any application. It could be web, it could be REST. It could be under Apache, WebLogic, WebSphere, or anything else.</p>