apiblueprint响应下载文件

时间:2020-07-29 02:43:41

标签: laravel apiblueprint

我正在尝试使用apiblueprint。

如何像下面的Laravel代码一样编写apib?

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文件

## getDownload [GET]

+ Response 200 (application/pdf)??

1 个答案:

答案 0 :(得分:0)

您缺少资源。应该是这样的:

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

### Download [GET]

+ Response 200 (application/pdf)