N/http Module Members
Explore N/http module members for SuiteScript, enabling powerful HTTP requests and responses within client and server scripts.
The N/http module is essential for making HTTP calls from both client and server-side scripts in NetSuite. It allows developers to handle various HTTP content types and facilitates cross-domain requests using NetSuite servers as proxies. Notably, the N/http module does not support the HTTPS protocol; for secure connections, the N/https module should be utilized instead.
Available N/http Module Members
The N/http module comprises several members categorized as objects, methods, and enumerations, enabling different aspects of HTTP handling in SuiteScript.
Objects
| Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|
| http.ClientResponse | Object (read-only) | Server scripts | The server's response to an HTTP client request, such as in http.get(options). |
| http.ServerRequest | Object (read-only) | Server scripts | Contains HTTP request information sent to a server, typically used by Suitelet and RESTlet. |
| http.ServerResponse | Object | Server scripts | Represents the response from an HTTP server to an HTTP request, used to send responses back. |
Methods
| Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|
| http.delete(options) | http.ClientResponse or http.ServerResponse | Client and server scripts | Sends an HTTP DELETE request and returns the response. |
| http.get(options) | http.ClientResponse or http.ServerResponse | Client and server scripts | Sends an HTTP GET request and returns the response. |
| http.post(options) | http.ClientResponse or http.ServerResponse | Client and server scripts | Sends an HTTP POST request and returns the response. |
| http.put(options) | http.ClientResponse or http.ServerResponse | Client and server scripts | Sends an HTTP PUT request and returns the response. |
| http.request(options) | http.ClientResponse or http.ServerResponse | Client and server scripts | Sends a general HTTP request and returns the response. |
Enumerations
| Name | Type | Supported Script Types | Description |
|---|---|---|---|
| http.CacheDuration | enum | Server scripts | Holds string values for supported cache durations. |
| http.Method | enum | Server scripts | Holds string values for supported HTTP methods. |
| http.RedirectType | enum | Server scripts | Holds string values for supported resources that can be redirected to. |
Additional Features
In addition to core functionalities, the N/http module provides extensive error handling and the ability to manipulate HTTP headers, which is crucial for robust script interactions.
Important Header Information
Certain HTTP headers are blocked from being manually set to prevent security issues. Developers should avoid trying to set these headers:
- Connection
- Content-Length
- Host
- JSESSIONID
- ...and others listed under the General Blocked and Suitelet Response HTTP Header Blocklists.
Understanding these members and best practices for using the N/http module effectively is vital for any SuiteScript developer aiming to implement HTTP operations within NetSuite seamlessly.
Who This Affects
- Developers: Those utilizing SuiteScript for advanced integrations.
- Administrators: Individuals managing custom scripts and functionalities in NetSuite.
Key Takeaways
- The N/http module provides tools for making HTTP requests and handling responses in SuiteScript.
- Certain headers are blocked to maintain security and data integrity.
- For secure HTTPS requests, developers must use the N/https module instead.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Does the N/http module support HTTPS connections?
Can the N/http module be used in both client and server scripts?
What happens if I try to set blocked HTTP headers like 'Content-Length' or 'Host'?
Are there any specific script types where http.ClientResponse and http.ServerResponse objects can be used?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category