diff --git a/msrest/async_client.py b/msrest/async_client.py index f749fbe..44f0c42 100644 --- a/msrest/async_client.py +++ b/msrest/async_client.py @@ -82,8 +82,8 @@ class AsyncServiceClientMixin: session.request, request.method, request.url, - request.data, - request.headers, + data=request.data, + headers=request.headers, **kwargs ) ) @@ -104,8 +104,8 @@ class AsyncServiceClientMixin: session.request, request.method, request.url, - request.data, - request.headers, + data=request.data, + headers=request.headers, **kwargs ) ) diff --git a/tests/async/test_async_client.py b/tests/async/test_async_client.py index c77cd63..16d009f 100644 --- a/tests/async/test_async_client.py +++ b/tests/async/test_async_client.py @@ -65,12 +65,12 @@ class TestServiceClient(object): await ServiceClient.async_send(mock_client, request) session.request.call_count = 0 mock_client._configure_session.assert_called_with(session) - session.request.assert_called_with('GET', None, [], {}, stream=True) + session.request.assert_called_with('GET', None, data=[], headers={}, stream=True) session.close.assert_called_with() await ServiceClient.async_send(mock_client, request, headers={'id':'1234'}, content={'Test':'Data'}) mock_client._configure_session.assert_called_with(session) - session.request.assert_called_with('GET', None, '{"Test": "Data"}', {'Content-Length': '16', 'id':'1234'}, stream=True) + session.request.assert_called_with('GET', None, data='{"Test": "Data"}', headers={'Content-Length': '16', 'id':'1234'}, stream=True) assert session.request.call_count == 1 session.request.call_count = 0 session.close.assert_called_with() @@ -79,7 +79,7 @@ class TestServiceClient(object): with pytest.raises(ClientRequestError): await ServiceClient.async_send(mock_client, request, headers={'id':'1234'}, content={'Test':'Data'}, test='value') mock_client._configure_session.assert_called_with(session, test='value') - session.request.assert_called_with('GET', None, '{"Test": "Data"}', {'Content-Length': '16', 'id':'1234'}, stream=True) + session.request.assert_called_with('GET', None, data='{"Test": "Data"}', headers={'Content-Length': '16', 'id':'1234'}, stream=True) assert session.request.call_count == 1 session.request.call_count = 0 session.close.assert_called_with()