HTTP Method Syntax in SuiteScript N/http Module
Understand the syntax for HTTP methods in SuiteScript's N/http module, essential for making HTTP calls.
The HTTP method is a crucial part of server request handling in SuiteScript's N/http module. This specifies the action to be performed when making HTTP requests, such as retrieving or sending data.
Property Description
- Property: The server request HTTP method.
- Type:
http.Method(read-only) - Module: N/http Module
- Parent Object:
http.ServerRequest
Read-Only Behavior
If you attempt to modify the method property, you will encounter the READ_ONLY_PROPERTY error, indicating that this property cannot be changed once set.
Supported HTTP Methods
The http.Method enumeration includes the following HTTP methods, each used to perform specific actions:
| Value | Description |
|---|---|
| DELETE | Used to remove resources. |
| GET | Retrieves data from a server. |
| HEAD | Fetches header information without the body. |
| PUT | Updates existing resources. |
| POST | Sends data to a server for processing. |
| PATCH | Applies partial modifications to a resource. |
Syntax Example
Here is a code example illustrating how to use the HTTP method within the http module, though this is not a full functional example:
1// Add additional code 2... 3log.debug({ 4 title: 'Server Request Method', 5 details: request.method 6}); 7... 8// Add additional codeFor complete script examples, refer to the N/http Module Script Samples.
General Notes on HTTP Headers
While working with HTTP requests, be mindful that certain HTTP headers cannot be modified when using the N/http module. These include headers such as Connection, Content-Length, and Host. Attempting to set these headers will result in their values being discarded. Understanding these limitations is crucial for effective script development in SuiteScript.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
What HTTP methods are available in the N/http module?
Can the HTTP method property be modified during a request in SuiteScript?
What happens if you try to set certain HTTP headers using the N/http module?
Is there a way to see the HTTP method used in a request with the N/http module?
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