Download file with a REST request needing headers and giving the content

后端 未结 4 829
甜味超标
甜味超标 2021-02-06 08:58

I am using AngularJs with a REST API. I don\'t have the hand on the REST API. I can store digital object with the API by sending a REST request. I can get it also with a GET req

4条回答
  •  名媛妹妹
    2021-02-06 09:46

    you can use this instead of above code :

    var url = config.domain + 'file/' + file;
       var parameters = "Authorization=" + user.auth +
                        "&secret-key=" + user.secretkey;
       var reportParameters = url + encodeURIComponent(parameters);
       window.location.assign(reportParameters);
    

提交回复
热议问题