diff options
Diffstat (limited to 'yardstick/common/httpClient.py')
-rw-r--r-- | yardstick/common/httpClient.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/yardstick/common/httpClient.py b/yardstick/common/httpClient.py index 6acd0303d..11c2d752d 100644 --- a/yardstick/common/httpClient.py +++ b/yardstick/common/httpClient.py @@ -6,9 +6,11 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import json +from __future__ import absolute_import + import logging +from oslo_serialization import jsonutils import requests logger = logging.getLogger(__name__) @@ -17,7 +19,7 @@ logger = logging.getLogger(__name__) class HttpClient(object): def post(self, url, data): - data = json.dumps(data) + data = jsonutils.dump_as_bytes(data) headers = {'Content-Type': 'application/json'} try: response = requests.post(url, data=data, headers=headers) |