N/http Module Syntax for SuiteScript Development
Learn the syntax for the N/http module in SuiteScript, including examples for setting CDN cache settings.
The N/http module in SuiteScript provides a set of functions to interact with HTTP requests and responses. Understanding its syntax is crucial for effective scripting within NetSuite.
Overview of N/http Module Syntax
The following code snippet illustrates how to use the syntax to set CDN cache settings in a server response:
1// Add additional code2...3ServerResponse.setCdnCacheable({4 type: http.CacheDuration.MEDIUM5});6...7// Add additional codeThis example demonstrates the setCdnCacheable method utilizing the http.CacheDuration.MEDIUM to define cache settings. It’s important to note that this code serves as a syntax reference rather than a complete functional example.
For detailed practical applications of the N/http module, refer to the N/http Module Script Samples.
Related Topics
- N/http Module
- SuiteScript 2.x Modules
- SuiteScript 2.x
Frequently Asked Questions (4)
How do I set CDN cache settings using SuiteScript's N/http module?
Is the provided code example for CDN cache settings a complete functional script?
Does the N/http module's CDN cache setting example work in all versions of SuiteScript?
Can I find more practical applications of the N/http module?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
