mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-22 22:27:17 +00:00
Base64 Problem
This commit is contained in:
parent
bc8df8e671
commit
7fb796172c
2 changed files with 1 additions and 26 deletions
|
@ -222,9 +222,6 @@ def get_item(request_dict):
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
# API as txt
|
||||
def get_item_as_txt(request_dict):
|
||||
item_id = request_dict.get('id', None)
|
||||
|
||||
|
@ -236,32 +233,12 @@ def get_item_as_txt(request_dict):
|
|||
return {'status': 'error', 'reason': 'Item not found'}, 404
|
||||
|
||||
item_content = get_item_content(item_id)
|
||||
base64_output = base64.b64encode(item_content.encode())
|
||||
base64_output = base64.b64encode((item_content.encode('utf-8')).decode())
|
||||
dict_item = {'id': item_id, 'content': base64_output}
|
||||
|
||||
return dict_item, 200
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
###
|
||||
### correlation
|
||||
|
|
|
@ -305,7 +305,6 @@ def delete_item_tags():
|
|||
@restApi.route("api/v1/get/item/content", methods=['POST'])
|
||||
@token_required('read_only')
|
||||
def get_item_content():
|
||||
|
||||
data = request.get_json()
|
||||
item_id = data.get('id', None)
|
||||
req_data = {'id': item_id, 'date': False, 'content': True, 'tags': False}
|
||||
|
@ -316,7 +315,6 @@ def get_item_content():
|
|||
@restApi.route("api/v1/get/item/content/text", methods=['POST'])
|
||||
@token_required('read_only')
|
||||
def get_item_content_text():
|
||||
|
||||
data = request.get_json()
|
||||
item_id = data.get('id', None)
|
||||
req_data = {'id': item_id}
|
||||
|
|
Loading…
Reference in a new issue