如何使用DropzoneJs发送身份验证令牌头?

时间:2019-02-11 19:59:19

标签: javascript dropzone.js

我在使用dropzonejs发送授权标头时遇到问题

switch (exit_code) {
  case QMessageBox::Save:
      // Save was clicked
      break;
  case QMessageBox::Discard:
      // Don't Save was clicked
      break;
  case QMessageBox::Cancel:
      // Cancel was clicked
      break;
  default:
      // should never be reached
      break;
}

1 个答案:

答案 0 :(得分:1)

基于the code,标头的定义如下:

var headers = {
    "Accept": "application/json",
    "Cache-Control": "no-cache",
    "X-Requested-With": "XMLHttpRequest"
  };

因此,定义类似于

headers: { "Authorization" : "Bearer AbCdEf123456" } 

应该工作。