#!/usr/bin/env python
# encoding: utf-8
# Copyright (C) Alibaba Cloud Computing
# All rights reserved.
from .util import Util
[docs]class LogResponse(object):
""" The base response class of all log response.
:type headers: dict
:param headers: HTTP response header
"""
def __init__(self, headers, body=''):
self.headers = headers
if body is None:
body = ''
self.body = body
[docs] def get_request_id(self):
""" Get the request id of the response. '' will be return if not set.
:return: string, request id
"""
return Util.h_v_td(self.headers, 'x-log-requestid', '')
[docs] def get_body(self):
""" Get body
:return: string
"""
return self.body
def log_print(self):
print('header: ', self.headers)