title: Groovy - REST API request which needs credential
body: <p>I need to make a request to a REST api using Groovy (alas I'm a Groovy novice...) and I need to pass the credentials (user and pwd) to access it when making the request.
  The API should then return some JSON which I can parse.</p>
  
  <p>I have seen some snippets of code here and there using HTTPBuilder, but I have not managed to make it work.</p>
  
  <p>Any idea to start from?
  I know that we are currently doing this in Python with a POST request, we the get some cookie and then we make a GET request.</p>
  
  <p>Thank you for your help!!</p>