File Download #4320
File Download
#4320
-
Hi We're building an OpenAPI compliant API that will return a pdf file from a get request. Rgds |
Beta Was this translation helpful? Give feedback.
Answered by
timotheeguerin
Sep 3, 2024
Replies: 1 comment 3 replies
-
You can do that by setting the content type and the body to be import "@typespec/http";
using TypeSpec.Http;
op download(): {
@header contentType: "application/pdf";
@body file: bytes;
}; |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
yeaharh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do that by setting the content type and the body to be
bytes
Playground