title: How to pass the credential to login to Jenkins from groovy script?
body: <p>I am trying access one of the Jenkins job's log using groovy script. but getting 403 error. How do I pass the credential to login in below code? </p>
  
  <pre><code>def jsonStr1 = new URL(myEnvUrl+"warnings40Result/api/json?pretty=true").getText()
  </code></pre>