📜  在 ajax 中传递标头 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:50.903000             🧑  作者: Mango

代码示例2
$.ajax({
  type: "POST",
  beforeSend: function(request) {
    request.setRequestHeader("Authority", authorizationToken);
  },
  url: "entities",
  data: "json=" + escape(JSON.stringify(createRequestObject)),
  processData: false,
  success: function(msg) {
    $("#results").append("The result =" + StringifyPretty(msg));
  }
});