urlencode $resource (fixes #113)

urlencode the `$resource` parameter by default.