':param url: the base URL to open.
:param method: the HTTP method to use.
Optional: defaults to \'GET\'
:param data: any data to pass (either in query for \'GET\'
or as post data with \'POST\')
:type data: dict'

def __init__(self, url, method='GET', data=None, **kwargs):

    self.url = url
    self.method = method
    self.data = (data or {})
    encoded_data = urlencode(self.data)
    if (method == 'GET'):
        self.url += ('?%s' % encoded_data)
        opened = urlopen(url)
    elif (method == 'POST'):
        opened = urlopen(url, encoded_data)
    else:
        raise ValueError(('Not    a    valid    method:    %s' % method))
    super(URLDataProvider, self).__init__(opened, **kwargs)
