jQuery-File-Upload by blueimp - additional headers

前端 未结 5 1793
野的像风
野的像风 2021-02-05 11:19

I\'ve searched through wiki but couldn\'t find an answer where should I put my additional headers (for example Authorization header) in JS script? Somewhere o

5条回答
  •  春和景丽
    2021-02-05 11:56

    Try something like this..

    beforeSend: function(xhr) {
        xhr.setRequestHeader("Accept", "application/json");
        xhr.setRequestHeader("Content-type", "application/json; charset=utf-8");
    }
    

提交回复
热议问题