Handling Form data in integration of NetSuite and a third party.

The function below can be used handle form-data.

const formDataString = Object.keys(data).map(key => {
                    return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]);
                }).join('&');
                log.debug("formDataString", formDataString);
                return formDataString;

Headers format for the APIconfiguration.

const headers = {};
                    headers['content-type'] = 'application/x-www-form-urlencoded'
                    headers['Authorization'] = apikey;
                    headers['Accept'] = 'application/json';
                    headers['Accept-Encoding'] = 'gzip, deflate, br';
                    return headers;

Leave a comment

Your email address will not be published. Required fields are marked *