title: How to provide username password when using Restful api in java?
body: <p>I have created basic authentication for a spring boot application which requires username and password.</p>
  
  <p>Using it from browser works fine, with a popup asking for password</p>
  
  <p><a href="https://i.stack.imgur.com/P59nD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P59nD.png" alt="enter image description here"></a></p>
  
  <p>But how do I use it in a java application?(preferably using jackson 2 but other tools are fine). Searching online only shows about web based login pages.</p>