aboutsummaryrefslogtreecommitdiffstats
path: root/commons/ims/readme.rst
blob: e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (plain)

span> import jsonutils from yardstick.common import constants as consts logger = logging.getLogger(__name__) def post(url, data={}): url = '{}{}'.format(consts.BASE_URL, url) data = jsonutils.dumps(data) headers = {'Content-Type': 'application/json'} try: response = requests.post(url, data=data, headers=headers) result = response.json() logger.debug('The result is: %s', result) return result except Exception as e: logger.exception('Failed: %s', e) raise def get(url): url = '{}{}'.format(consts.BASE_URL, url) response = requests.get(url) return response.json()