'Returns the parameters for this task.
Returns:
A dictionary of strings mapping parameter names to their values as
strings. If the same name parameter has several values then the value will
be a list of strings. For POST and PULL requests then the parameters are
extracted from the task payload. For all other methods, the parameters are
extracted from the url query string. An empty dictionary is returned if
the task contains an empty payload or query string.
Raises:
ValueError: if the payload does not contain valid
\'application/x-www-form-urlencoded\' data (for POST and PULL) or the url
does not contain a valid query (all other methods).'

def extract_params(self):

    if (self.__method in ('PULL', 'POST')):
        query = self.__payload
    else:
        query = urlparse.urlparse(self.__relative_url).query
    p = {}
    if (not query):
        return p
    for (key, value) in cgi.parse_qsl(query, keep_blank_values=True, strict_parsing=True):
        p.setdefault(key, []).append(value)
    for (key, value) in p.items():
        if (len(value) == 1):
            p[key] = value[0]
    return p
