我正在使用以下内容进行 http GET:
$.ajax({
type: 'GET',
url: server + '/hello',
dataType: 'json',
async: false,
xhrFields: {
withCredentials: true
},
success: function(data){
if(data.connected){
},
error: function(a, b, c){
}
});
我看到这些设置在标题中:
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Authorization:Basic bGlkerrdN1NDpTdW55ytXIwMA==
Connection:keep-alive
Cookie:OBBasicAuth=fromCache;
ObSSOCookie=
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.10 Safari/537.36
Response Headersview source
在 Javascript 或 JQuery 中有没有办法获得授权部分?