View our GitHub

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

Edit Page

req.path

The URL pathname from the request URL string of the current request (req). Note that this is the part of the URL after and including the leading slash (e.g. /foo/bar), but without the query string (e.g. ?name=foo) or fragment (e.g. #foobar.)

Usage

req.path;

Example

Assuming a client sends the following request:

http://localhost:1337/donor/37?name=foo#foobar

req.path will be defined as follows:

req.path;
// -> "/donor/37"

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.

Reference

We wrote a book!

Get early access to the book
with promotion code: mcneildoc

Get the Book