I'm trying to do a simple REST api in a CakePhp app, using a REST plugin I found, which for Authorization uses http headers.
My question is, how can I supply through jQuery using json, a header like for example:
Authorization: TRUEREST username=wwwww&password=zzzzz&apikey=xxxxxyyyyyyy
$.ajax({
// ...
beforeSend: function(x) {
x.setRequestHeader('Authorization', 'TRUEREST username=wwwww&password=zzzzz&apikey=xxxxxyyyyyyy');
},
// ...
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.