apiblueprint response download file

180 Views Asked by At

I'm trying to use apiblueprint.

How do I write the apib just like as below Laravel code?

public function getDownload()
{
    //PDF file is stored under project/public/download/info.pdf
    $file= public_path(). "/download/info.pdf";

    $headers = array(
              'Content-Type: application/pdf',
            );

    return Response::download($file, 'filename.pdf', $headers);
}

 apib file

## getDownload [GET]

+ Response 200 (application/pdf)??
1

There are 1 best solutions below

0
Patrick Silva On BEST ANSWER

You are missing the Resource. It should be something like:

## Resource Title [/path-to-get-the-pdf]

### Download [GET]

+ Response 200 (application/pdf)