Warning Unreleased Docs! - You may be viewing documentation that reflects an upcoming release and the functionality described may not be in the current version you are using. Change the version above to the most recent version.

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