Skip to content

File Download #4320

Answered by timotheeguerin
yeaharh asked this question in Q&A
Sep 3, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

You can do that by setting the content type and the body to be bytes

import "@typespec/http";

using TypeSpec.Http;

op download(): {
  @header contentType: "application/pdf";
  @body file: bytes;
};

Playground

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@yeaharh
Comment options

@timotheeguerin
Comment options

@yeaharh
Comment options

Answer selected by yeaharh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants