HTTP Request Headers Syntax in SuiteScript
Understand HTTP request headers in SuiteScript, including usage, limitations, and best practices for authentication.
The header information included in an HTTP call consists of key-value pairs that represent request headers. Each header can be referenced using either lowercase or title case; however, for consistency, it is recommended to use lowercase whenever possible. Additionally, custom headers should not include underscores.
Important Note on Custom Headers
The Authorization header is specifically designated for OAuth-authenticated requests. If you intend to implement your own authentication mechanism, use custom header names like X-Authorization instead.
Header Variations and Filtering
Be aware that some headers are subject to change based on system conditions. When sending requests to a Suitelet, certain headers might be filtered out to prevent conflicts with NetSuite’s internal processing. Therefore, it’s crucial to test your headers to ensure they contain the expected values. If you find that some headers are filtered out, select alternative headers.
Object Type
- Type: Object (read-only)
- Module: [N/http Module]
- Parent Object: [http.ServerRequest]
Error Handling
- Error Code:
READ_ONLY_PROPERTY - Thrown If: You attempt to edit this property, as it is read-only.
Code Sample
The following code snippet illustrates how to log the headers of a server request:
1// Add additional code 2...3log.debug({4 title: 'Server Request Headers',5 details: request.headers6});7...8// Add additional codeGeneral Blocked HTTP Headers
Be mindful of specific headers that are not permitted when using the N/http module. Attempts to set the following headers will result in discarded values:
ConnectionContent-LengthHostJSESSIONIDTrailerTransfer-EncodingUpgradeVia
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- Use lowercase for header names for consistency in HTTP calls.
- Custom headers should avoid underscores.
- Test headers for filtering when interacting with Suitelets.
- Certain headers, like
Authorization, have predefined roles in NetSuite scripts. - Understand the limitations of specific headers based on NetSuite’s restrictions.
Frequently Asked Questions (4)
What are the implications of using custom HTTP request headers with underscores in SuiteScript?
Are there any specific headers that are filtered out when making requests to a Suitelet?
What headers are automatically blocked when using the N/http module in SuiteScript?
In SuiteScript, is it possible to modify the request headers object?
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