• Getting Started
  • Source Adapters
  • Source Adapter Ruby APIs
  • Source Adapter JS APIs
  • Plugins
  • Push Sync
  • Administration
  • Deployment
  • Advanced Topics
  • Clients
  • Hosted Services
  • Vendor Adapters
Warning Older Docs! - You are viewing documentation for a previous released version of RhoMobile Suite.

Source Adapter Request API (JavaScript)

The Source Adapter Request API provides access to an incoming HTTP request context and can be used in your controller.

params

A hash of parameters available from the request.

app.post("/login",{"rc_handler":"authenticate"}, function(req,resp){
  var login = req.params.login;
  var password = req.params.password;
  if(someAuthFunction(login,password) === true) {
    resp.send(false);
  } else {
    resp.send(true);
  }
});

header

Access the request headers.

req.header['Content-Type']
// 'application/json'

model

Returns the model name for the request.

req.model
//=> 'Product'
Back to Top