def _JsonResponse(data): SetResponseHeader('Content-Type', 'application/json') return json.dumps(data, default=_UniversalSerialize)
def SetHmacHeader( body, hmac_secret ): value = b64encode( hmac_utils.CreateHmac( ToBytes( body ), ToBytes( hmac_secret ) ) ) SetResponseHeader( _HMAC_HEADER, value )
def _JsonResponse(data, file_encoding='utf8'): SetResponseHeader('Content-Type', 'application/json') return json.dumps(data, encoding=file_encoding, default=_UniversalSerialize)