I am launching requests to a web service using Groovy/XmlSlurper:
new XmlSlurper().parse("http://en.wikipedia.org/w/api.php?action=...")
I would like to set the user agent to let the website know what project the requests are from.
How to set the user agent?
- XMLSlurper's constructors do not have anything like this.
- The setProperty method sounds interesting but Google does not lead to anything related to UA.
- I would rather avoid changing the code to abandon XmlSlurper in favor of another library.