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