Function Updated 22 Oct 2026
request()
Get information about the current request from the request object.
Parameters
This function takes no parameters.
Returns
An object with information about the current request:
| Member | Description |
|---|---|
method | HTTP method in upper case (GET, POST …). Null when no HTTP request exists (scheduled service). |
user | Email of the signed-in Docly user, or null |
Jwt | Payload of the custom JWT cookie (see writeJwt). Only set in API functions — always null in .hash pages |
url, Url | Site-relative URL as the site serves it (spaces become -) |
rawurl, rawUrl | Site-relative URL with the names as they are on the drive |
completeUrl, encodedUrl, encodedFileUrl | Absolute URL as the site serves it |
siteUrl | Absolute URL of the site root |
urlpath | Path part of the URL |
filepath, filename | Path and name of the file that answers the request |
folderpath, foldername | Path and name of the folder |
fileId, fileGuid, folderId, folderGuid | Ids of the file and the folder |
opendoc, openfolder | URLs that open the document or folder in the editor |
sitename, sitepath, sitefolder, sitemodified | The published folder: name, path, folder and last change |
template, title | Template in use and page title |
isIndex, folderNotFound | Whether the request is for a folder index, and whether the folder of a 404 request was NOT found (true = the folder does not exist) |
authMode | Login mode of the publication, or null |
Query string and form values are not on request — read them with query and form in API functions.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
write(JSON.format(JSON.stringify(request)));The JavaScript above produces this output:
{
"filepath": "/JavaScript/Output functions/request",
"urlpath": "/JavaScript/Output-functions/request",
"fileId": "28BC4",
"folderId": "B31E",
"fileGuid": "TISeyyiBzE6XYO0A6Ukq4w",
"folderGuid": "N7_jdBoRWk2PPT-_EU4QEg",
"foldername": "Output functions",
"folderpath": "/JavaScript/Output functions/",
"opendoc": "https://docly.net/DTISeyyiBzE6XYO0A6Ukq4w?backurl=https%3a%2f%2fdevelopers.docly.net%2fJavaScript%2fOutput-functions%2frequest",
"openfolder": "https://docly.net/FN7_jdBoRWk2PPT-_EU4QEg",
"sitefolder": "https://docly.net/FTuZZ9eKfuU2aBqBzJEL5Aw",
"sitename": "developers.docly.net",
"sitepath": "/",
"sitemodified": "2026-11-03T11:24:26.784Z",
"template": "",
"title": "request",
"isIndex": false,
"is404": false,
"folderNotFound": false,
"url": "/JavaScript/Output-functions/request",
"Url": "/JavaScript/Output-functions/request",
"rawurl": "/JavaScript/Output-functions/request",
"rawUrl": "/JavaScript/Output-functions/request",
"completeUrl": "https://developers.docly.net/JavaScript/Output-functions/request",
"encodedFileUrl": "https://developers.docly.net/JavaScript/Output-functions/request",
"encodedUrl": "https://developers.docly.net/JavaScript/Output-functions/request",
"siteUrl": "https://developers.docly.net/",
"method": "GET",
"user": null,
"Jwt": null,
"filename": "request",
"authMode": null
}