ServerRequest.url

Property Description

The server request URL.

Type

string (read-only)

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/https Module

Since

2015.2

Errors

Error Code

Thrown If

READ_ONLY_PROPERTY

You attempted to edit this property. This property is read-only.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.

          // Add additional code 
...
log.debug({
    title: 'Server Request URL',
    details: request.url
});
...
// Add additional code 

        

Code Samples

Note:

This script sample uses the define function, which is required for an entry point script (a script you attach to a script record and deploy). You must use the require function if you want to copy the script into the SuiteScript Debugger and test it. For more information, see SuiteScript 2.x Global Objects

          /**
 *@NApiVersion 2.x
 *@NScriptType Suitelet
 */
 define([], function() {
    function onRequest(context) {        
        var url = context.request.url; // https://XXXXXXX.app.netsuite.com/app/site/hosting/scriptlet.nl
        ...
        // Add additional code
        ... 
    }
 
    return {
        onRequest: onRequest
    };
}); 

        

Related Topics

General Notices