HTTP DELETE Request Errors in SuiteScript

Understand HTTP DELETE request errors in SuiteScript, including common issues and their solutions.

·2 min read·View Oracle Docs

The HTTP DELETE request in SuiteScript allows developers to remove resources through an API. This method is critical for maintaining data integrity and application functionality. However, developers may encounter various errors when executing DELETE requests. Understanding these errors helps in troubleshooting and ensuring smoother integrations.

Method Description

The HTTP DELETE method sends a request to delete a specified resource. Key behaviors include:

  • If the connection to the destination server takes longer than 5 seconds, it times out.
  • Request payloads that exceed 45 seconds are also timed out.
  • It cannot be executed in unauthenticated client-side contexts, which can limit usability in certain scenarios.

Returns

The method returns:

  • http.ClientResponse or http.ServerResponse

Supported Script Types

This method is compatible with:

  • Client scripts
  • Server scripts

For more details, refer to the SuiteScript 2.x Script Types.

Governance

Using this method consumes 10 units of governance.

Module

This functionality is part of the N/http Module.

Parameters

The options parameter is a JavaScript object that includes:

ParameterTypeRequired/OptionalDescription
options.urlstringRequiredThe fully qualified HTTP/HTTPS URL being requested.
options.headersObjectOptionalThe HTTP headers to include in the request.

Errors

Developers may face several common error codes when using the DELETE request:

Error CodeMessageThrown If
SSS_INVALID_HOST_CERTAn untrusted, unsupported, or invalid certificate was found.The client and server couldn’t negotiate security.
SSS_INVALID_URLThe URL must be a fully qualified HTTP/HTTPS URL.An invalid URL is specified in options.url.
SSS_MISSING_REQD_ARGUMENTMissing a required argument: {param name}The options.url parameter is not specified.

Syntax Example

Here's a basic example demonstrating the usage of the http.delete() method:

suitescript
1// Add additional code
2...
3var headerObj = {
4 name: 'Accept-Language',
5 value: 'en-us'
6};
7var response = http.delete({
8 url: 'http://www.mytestwebsite.com',
9 headers: headerObj
10});
11...
12// Add additional code

For comprehensive examples, refer to the N/http Module Script Samples.

Understanding these important aspects of the HTTP DELETE method and its error handling can significantly improve the effectiveness of API interactions in SuiteScript development.

Frequently Asked Questions (4)

What type of scripts can use the HTTP DELETE method in SuiteScript?
The HTTP DELETE method can be used in both client scripts and server scripts in SuiteScript.
What happens if the HTTP DELETE request in SuiteScript takes too long to execute?
If the connection to the destination server takes longer than 5 seconds, it will time out. Additionally, request payloads that take longer than 45 seconds will also time out.
Is authentication required to execute an HTTP DELETE request in SuiteScript?
Yes, the HTTP DELETE request cannot be executed in unauthenticated client-side contexts, which may limit its usability in some scenarios.
What are some common errors encountered when using the HTTP DELETE method in SuiteScript?
Common errors include `SSS_INVALID_HOST_CERT` due to an invalid certificate, `SSS_INVALID_URL` for a malformed URL, and `SSS_MISSING_REQD_ARGUMENT` if the `options.url` parameter is not specified.
Source: Errors Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Integration

View all Integration articles →