N/https Module: Binary File Support in NetSuite 2025.2

Starting in NetSuite 2025.2, the N/https module now supports sending binary files, enhancing secure integrations with third-party systems.

·3 min read·14 views·View Oracle Docs

TL;DR Opening

Starting in NetSuite 2025.2, the N/https module was updated to include support for binary file transfers through HTTPS, streamlining secure communications with external systems and significantly enhancing the way binary data is managed.

What's New in N/https Module

The N/https module serves as a vital bridge for SuiteScript interactions involving HTTPS requests, allowing both client and server scripts to communicate securely with external endpoints. With the introduction of updates in this module, developers can utilize new capabilities to send binary content more seamlessly and securely.

Key Features of N/https Module

  • Binary File Support: You can now post binary files using Uint8Array, with the module automatically handling the appropriate content type for these files. Ensure that your files use a suitable Content-Type header, as multipart/form-data is not supported.
  • HTTPS Only: The module restricts communications to HTTPS, enhancing security through encrypted data transfers and reinforcing compliance with modern security standards by requiring TLS 1.2 for all requests.
  • Built-in Integration: The N/https module supports communication between SuiteScript scripts, RESTlets, and SuiteTalk APIs without the need for reauthentication, making it easier to integrate with various NetSuite functionalities.

Important Considerations

  • Timeouts: Be aware that if a connection takes longer than 5 seconds or if sending request data exceeds 45 seconds, the operation will result in a timeout.
  • Authentication: Utilize secure authentication methods such as Token-based Authentication (TBA) or OAuth 2.0 when dealing with user credentials to mitigate security risks associated with plain text credentials.
  • Trusted CAs: Ensure that the targeted endpoints utilize one of the trusted certificate authorities recognized by NetSuite. Connections will fail if the full certification chain, including intermediate certificates, is not provided.

Sending Binary Data with https.post(options)

You can create a POST request to send binary data as follows:

require(['N/https'], function(https) {
    var options = {
        url: 'https://example.com/api/upload',
        body: new Uint8Array([/* binary data */])
    };
    var response = https.post(options);
});

Use the https.SecureString type to ensure any URLs with special characters are properly escaped. This is essential for accurate connectivity.

Who This Affects

  • Developers: Those creating SuiteScripts will significantly benefit from the added functionality regarding binary data.
  • Administrators: Understanding these changes is essential for proper implementation and security practices.
  • Integrators: Anyone working with third-party integrations will find the enhancements to the N/https module beneficial for secure data transfers.

Key Takeaways

  • The N/https module in NetSuite 2025.2 now supports sending binary files through HTTPS requests.
  • Binary data is handled via Uint8Array, but multipart/form-data is not permitted.
  • Implement TLS 1.2 for all HTTP connections to meet security requirements.
  • Ensure that apps connecting to NetSuite follow the trusted certificate authorities for secure interactions.
  • Leverage secure authentication methods to enhance security and protect sensitive data.

Frequently Asked Questions (4)

Does the N/https module in NetSuite 2025.2 support multipart/form-data for binary files?
No, the N/https module does not support multipart/form-data for binary files. You should use Uint8Array for posting binary files, ensuring the appropriate content type is set.
What authentication methods are recommended when using the N/https module?
It is recommended to use secure authentication methods such as Token-based Authentication (TBA) or OAuth 2.0 to mitigate risks associated with plain text credentials.
Are there any timeout constraints when using the N/https module for HTTPS requests?
Yes, the N/https module has a timeout constraint where connections taking longer than 5 seconds or sending data exceeding 45 seconds will result in a timeout.
Is there any special consideration for the certificate authorities when using the N/https module?
Yes, targeted endpoints must use one of the trusted certificate authorities recognized by NetSuite. Connections will fail if the full certification chain, including intermediate certificates, is not provided.
Source: SuiteScript Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?