代码拉取完成,页面将自动刷新
Make digest-auth ajax requests with javascript. Only depency is CryptoJS MD5.
More info on Digest Auth: http://en.wikipedia.org/wiki/Digest_access_authentication Currently only supports "auth" quality-of-protection type.
GET request:
var url = 'http://example.com/protected-resource';
// create digest request object
var getRequest = new digestAuthRequest('GET', url, 'username', 'password');
// make the request
getRequest.request(function(data) {
// success callback
// do something with the data
},function(errorCode) {
// error callback
// tell user request failed
});
// make additional GET requests here...
POST request:
var postData = {
address: '123 main st.',
city: 'Denver',
state: 'Colorado'
}
// create new digest request object
// because method (POST vs GET) is different
// otherwise we could re-use the first one
var postReq = new digestAuthRequest('POST', url, 'username', 'password');
postReq.request(function(data) {
// success callback
// data probably a success message
},function(errorCode) {
// error callback
// tell user request failed
}, postData);
Out of the box digestAuthRequest.js has logging turned on so you can debug. Set loggingOn
to false to disable it.
digestAuthRequest.js
in the rootyarn build
or simply gulp
.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。