add url encoding and http agent