From b96ba6326af442edfdad59e5e42ea42892cd3c6b Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Sun, 16 Dec 2012 10:24:23 +1100 Subject: show: indicate length, encoding of omitted body content If a leaf part's body content is omitted, return the encoded length and transfer encoding in --format=json output. This information may be used by the consumer, e.g. to decide whether to download a large attachment over a slow link. Returning the _encoded_ content length is more efficient than returning the _decoded_ content length. Returning the transfer encoding allows the consumer to estimate the decoded content length. --- devel/schemata | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'devel') diff --git a/devel/schemata b/devel/schemata index 292f2876..2405756e 100644 --- a/devel/schemata +++ b/devel/schemata @@ -77,7 +77,14 @@ part = { # A leaf part's body content is optional, but may be included if # it can be correctly encoded as a string. Consumers should use # this in preference to fetching the part content separately. - content?: string + content?: string, + # If a leaf part's body content is not included, the length of + # the encoded content (in bytes) may be given instead. + content-length?: int, + # If a leaf part's body content is not included, its transfer encoding + # may be given. Using this and the encoded content length, it is + # possible for the consumer to estimate the decoded content length. + content-transfer-encoding?: string } # The headers of a message or part (format_headers_sprinter with reply = FALSE) -- cgit v1.2.3