use urlparse instead of string formatting
set doseq=True so that queries are serialized correctly