Download a file using Angular 6 and Spring Rest API

后端 未结 1 1773
执念已碎
执念已碎 2021-01-16 05:20

I have a problem downloading a file from a rest api using angular 6

Back-end method

  @RequestMapping(value = \"/print/{id}\")
    public ResponseEnt         


        
1条回答
  •  天涯浪人
    2021-01-16 06:16

    Try adding content-type to your request headers. You can try this as an exemple:

    let headers = new Headers({'Content-Type': 'application/pdf', 'Accept': 'application/pdf'});
    

    0 讨论(0)
提交回复
热议问题