url encoding, and a macro to define url params and options