1. Package name change
New pakcage name is net.sourceforge.urlconnbuilder.
2. Better support for proxy
----
URLConnectionBuilder connBuilder = new URLConnectionBuilder()
connBuilder.url('http://groovy.codehaus.org/') {
connect(proxy: 'http://proxyhost:proxyport') {
configure(
// configure URLConnection
)
communicate(
input: { conn, stream ->
println stream.text
}
)
}
}
----
URL version:
----
proxy: new URL('http://proxyhost:proxyport')
----
URI version:
----
proxy: URI.create('socks5://proxyhost:proxyport')
----
3. Support for authentication
----
URLConnectionBuilder connBuilder = new URLConnectionBuilder()
connBuilder.url('http://groovy.codehaus.org/') {
connect(authentication: 'username:password') {
configure(
// configure URLConnection
)
communicate(
input: { conn, stream ->
println stream.text
}
)
}
}
----
List version:
----
authentication: [ 'username', 'password' ]
----
Map version:
----
authentication: [ username: 'username', password: 'password' ]
----
No comments:
Post a Comment