diff --git a/aiohttp/client.py b/aiohttp/client.py index 2e450391839..89c776de2fa 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -189,7 +189,7 @@ def __init__(self, method, url, *, self.update_version(version) self.update_host(url) - self.update_path(params, data) + self.update_path(params) self.update_headers(headers) self.update_cookies(cookies) self.update_content_encoding() @@ -264,7 +264,7 @@ def update_version(self, version): .format(version)) from None self.version = version - def update_path(self, params, data): + def update_path(self, params): """Build path.""" # extract path scheme, netloc, path, query, fragment = urllib.parse.urlsplit(self.url) @@ -276,12 +276,6 @@ def update_path(self, params, data): elif isinstance(params, MultiDict): params = list(params.items(getall=True)) - # for GET request include data to query params - if data and self.method in self.GET_METHODS: - if isinstance(data, dict): - data = data.items() - params = list(itertools.chain(params or (), data)) - if params: params = urllib.parse.urlencode(params) if query: diff --git a/tests/test_client.py b/tests/test_client.py index 35a1fac73a8..ebb95477795 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -508,7 +508,8 @@ def test_get_with_data(self): for meth in ClientRequest.GET_METHODS: req = ClientRequest( meth, 'http://python.org/', data={'life': '42'}) - self.assertEqual('/?life=42', req.path) + self.assertEqual('/', req.path) + self.assertEqual(b'life=42', req.body) def test_bytes_data(self): for meth in ClientRequest.POST_METHODS: