Skip to content

API refactoring; new error handling flow #270

@psolom

Description

@psolom

Changes in the API for v2.7.0

  1. getfile API method should be RENAMED to getinfo and return either file or folder stats. Restriction to handle files only should be removed.

  2. getfolder API method should be RENAMED to readfolder. No changes in functionality.

  3. API methods readfile, getimage and download should USE THE SAME FLOW to read file and write it to the output. The difference will be in headers and restrictions (validation checks) only. Read/Write flow features which should be implemented (preferably):

    • read in small chunks in order to handle big size files;
    • handle HTTP RANGE for media files;
  4. editfile API method should be REMOVED, instead of it the readfile is used at the client-side.

  5. download API method should be simplified and handled with a single request. Implemented within the commit af60b30

  6. The error handling. When fire an error you have to add the following HTTP headers to the response:

        header('Content-Type: application/json');
        header('HTTP/1.1 500 Internal Server Error');

Also API error format sould correspond to JSON API standard. Imlemented within #210

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions