From 651568ff85bde4aa152ba18eed8b587f4f2f3cab Mon Sep 17 00:00:00 2001 From: NavaL Date: Mon, 21 Dec 2015 10:44:37 +0100 Subject: added filename and size to the attachment endpoint post response Issue #548 --- service/pixelated/resources/attachments_resource.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'service/pixelated/resources/attachments_resource.py') diff --git a/service/pixelated/resources/attachments_resource.py b/service/pixelated/resources/attachments_resource.py index 05bc923f..19b5d0bc 100644 --- a/service/pixelated/resources/attachments_resource.py +++ b/service/pixelated/resources/attachments_resource.py @@ -94,7 +94,11 @@ class AttachmentsResource(Resource): def send_location(attachment_id): request.headers['Location'] = '/%s/%s' % (self.BASE_URL, attachment_id) - respond_json_deferred({"attachment_id": attachment_id}, request, status_code=201) + response_json = {"attachment_id": attachment_id, + "content-type": _file.type, + "filename": _file.filename, + "filesize": len(_file.value)} + respond_json_deferred(response_json, request, status_code=201) def error_handler(error): print error -- cgit v1.2.3