title: Grails Basic Authentication credentials passed in URL
body: <p>I'm trying to access some URL to fetch a JSON file from my Grails application, but could not find a way to pass authentication credentials.</p>
  
  <p>I'm trying this code to get pass authentication</p>
  
  <pre><code>String url = 'http://urlThatIwantToGoTo.com'
  String ID = 'my_ID'
  String PW = 'my_PW'
  String website = 'http://my_ID:my_PW@urlThatIwantToGoTo.com'
  
  String jsonFile = new JsonSlurper().parseText(new URL(website).text)
  </code></pre>
  
  <p>But I'm still getting 401 errors.</p>