- def send_request(self, url, data=None, timeout=30):
- logger.debug("Sending request: %s" % url)
+ def send_request(self, url, method="GET", data=None, timeout=30):
+ assert method in ("GET", "POST")
+
+ # Add all arguments in the data dict to the URL and escape them properly.
+ if method == "GET" and data:
+ query_args = self._format_query_args(data)
+ data = None
+
+ url = "%s?%s" % (url, query_args)
+
+ logger.debug("Sending request (%s): %s" % (method, url))