Closed apsylone closed 11 years ago
you can use the header functionality, look here: https://github.com/viezel/napp.alloy.adapter.restapi/blob/master/restapi.js#L51
Yes but I think we should maybe use the class properly : http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient-property-password http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient-property-username http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient-property-withCredentials
authString: 'Basic ' + Titanium.Utils.base64encode(username+':'+password),
no, because you cannot access the httpclient with standard backbone methods. This is why header is used..
You should maybe put an example in the documentation so... :-) Or explaining me 'how to' add headers :-)
sure.. Its all in the Backbone docs..
collection.fetch({
headers: {
Authorization: 'Basic ' + Titanium.Utils.base64encode(username+':'+password)
}
});
Great ! Really thanks for your help... Sorry for the question, i'm not comfortable with Backbone...
sure thing.. :)
Just wanted to throw in that the param name should be 'headers' rather than 'header'
Threw me off for a bit.
sorry about that.. Ive updated the comment.
No worries. Thanks for the great adapter. Cheers!
I would like to use the adapter with HTTP Basic Auth. It seems like I have to modify the file in order to have the "username" and "password" headers set.
It would be really useful to implements the method.