Issues/149 url encoding

Please review #149, and merge to 1.0.x.