-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update jQuery.Bridge.js #1
base: master
Are you sure you want to change the base?
Conversation
Settings: settings.usePost: Request type (GET or POST), settings.useJsonP: request format (JSON or JSONP), settings.addHeaders: request headers ({Header_Name_One: 'Header Value One'}); bridge.requestPage: ajax request with type, datatype and headers
Hi there Salvo, first of all, thank you for your pull request.
|
Great Simon, thanks for reply. |
Here's the commit made in response to this issue. Tell me if the code match what you suggested. |
Just one effort: requesting only with GET, in respect of REST architecture prospective, there's a problem with JSONP: it works because it is a hack that doesn't use AJAX, it does NOT use a XMLHttpRequest at any point to send the data (that is how it gets around the Same Origin Policy); then it would be usefull to mantain a GET/POST switch, in case backend endpoints cant or want process custom additional headers. |
Actually I don't think that jBridge needs to request JSONPs. All that it does by now is retrieving pages and to accomplish that, in a REST architecture, the client have to make a GET request (http://en.wikipedia.org/wiki/Representational_state_transfer#Applied_to_Web_Services). |
Settings:
settings.usePost: Request type (GET or POST),
settings.useJsonP: request format (JSON or JSONP),
settings.addHeaders: request headers ({Header_Name_One: 'Header Value One'});
bridge.requestPage:
ajax request with type, datatype and headers