休息 API 使用授权密钥?

Rest API Using Authorization Key?

这是我第一次开始研究 Rest API 的

我找了很多资源都找不到

根据文档这必须是我的请求 header 并且请求将是 POST

"Authorization": "125THIS123IS123TEST1354",
"cache-control": "no-cache",
"content-type": "application/json"

我尝试了很多次发送数据,但收到 401 未经授权的错误。

$.ajax({ 
   type: "POST",    
   url: 'https://testurl/api/test',    
   headers: {    
       'Authorization': '125THIS123IS123TEST1354',    
       'content-type': 'application/json',    
       'cache-control': 'no-cache'    
   },    
   success: function (data) {    
       alert('success')  
   },    
   failure: function (msg) {    
       alert(msg);    
   }    
});    

我不知道我的方法是正确的还是他们的其他方法.....

使用

'Authorization': 'Bearer 125THIS123IS123TEST1354',   

对于 asp.net 网络上的来源 API

https://github.com/RemmSoft/rs-webapi2-advance-seed