Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a file when outputType is file #23

Open
d98762625 opened this issue Jul 3, 2020 · 0 comments
Open

Return a file when outputType is file #23

d98762625 opened this issue Jul 3, 2020 · 0 comments

Comments

@d98762625
Copy link
Member

d98762625 commented Jul 3, 2020

outputType is an optional parameter that can be specified when POSTing to /bake. When outputType is set as "file" or 7, the application should return a file.

Describe the solution you'd like

  • if outputType=file in the request, the application should:

    • set Content-Disposition to attachment in the response
    • only return the dish value as the payload, so that if you pipe the response to a file, it should only contain the value.
  • this behaviour should apply to multipart and body POSTs

For reference (with multipart at least), the response when outputType=7 is:

type: "FILE",
value: {
    data: {
        data: [
        84,
        104,
        101,
        32,
        99
        ],
        type: "Buffer"
    },
    lastModified: 1593784118511,
    name: "unknown",
    type: "application/unknown",
}

test for outputType = file is:

  • expect a file of binary data out (e.g. png). Write it to x.png and open it. it should be valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant