View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page


Sends a virtual request to a Sails server using

This function is very similar to io.socket.get(),, etc. except that it provides lower-level access to the request headers, parameters, method, and URL of the request.

This function is provided by the JavaScript client, and is accessible in the browser.


io.socket.request(options, function (data, jwr)){
  // ...
  // jwr.headers
  // jwr.statusCode
  // jwr.body === data
  // ...


  method: 'get',
  url: '/user/3/friends',
  params: {},
  headers: {}

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.


We wrote a book!

Get early access to the book
with promotion code: mcneildoc

Get the Book