📜  在表单提交上设置授权标头 - 无论代码示例

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

代码示例1
$('#submitButton').on('click',function(){
    $.ajax({
          url: "http://localhost:15797/api/values",
          type: 'GET',
          contentType: 'application/json',
          headers: {
                    "Authorization": "Bearer " + $('#tokenField').val()
                 },
          async: false
            }});