Request a URL Using http.get

The following sample shows how to use an HTTP GET request for a URL.

Note:

This sample script uses the require function so that you can copy it into the SuiteScript Debugger and test it. You must use the define function in an entry point script (the script you attach to a script record and deploy). For more information, see SuiteScript 2.x Script Basics and SuiteScript 2.x Script Types.

Important:

This sample uses SuiteScript 2.1. For more information, see SuiteScript 2.1.

          /**
 * @NApiVersion 2.1
 */

// This script uses an HTTP GET request for a URL.
require(['N/http'], (http)=> {
    function sendGetRequest() {
        let response = http.get({
            url: 'http://www.google.com'
        });
    }
    sendGetRequest();
}); 

        

General Notices