[issue2551068] Provide way to retrieve file/msg data via rest endpoint.

John Rouillard <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from John Rouillard:

>From msg6749:
====
... I wonder if we should provide a
way via the rest interface to download just the content data in raw
form.

I think the right way to do this is to make the request to
demo/data/file/11/content but set the header:

 Accept:  image/vnd.microsoft.icon

If the content type matches the file type, respond with a binary data
stream with appropriate Content-Type (either the same as the Accept
type or application/octet-stream) and Content-Length. If it doesn't
match we return 406 - not acceptable.
===

If we do not set an acept header, or set accept to application/json
or application/xml (if enabled) we get back the standard data wrapped
output like (json format):

  {
    "data": {
        "id": "1",
        "type": "file",
        "link": "https://.../demo/rest/data/file/1",
        "attributes": {
            "content": {
                "link": "https://.../demo/file1/"
            },
            "name": "android-chrome-192x192.png",
            },
            "type": "image/png"
        },
        "@etag": "\"94c0e14629da6944d9ab2a83546d0737\""
    }
  }


Details and discussion are on: issue2551067 specifically at msg6749

----------
components: API
keywords: rest
messages: 6780
nosy: rouilj
severity: normal
status: new
title: Provide way to retrieve file/msg data via rest endpoint.
type: rfe

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551068>
_________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.