This topic contains 5 replies, has 0 voices, and was last updated by ironside 8 years, 1 month ago.
-
AuthorPosts
-
September 20, 2016 at 9:52 am #1787
davidturtonI keep getting this error when trying to use the promise with https.get, any ideas?
org.mozilla.javascript.EcmaError: TypeError: Cannot find function promise in object function (options, headers) {…}.
https.get.promise(url: baseUrl)
.then(function(response){
log.debug({
title: ‘Response’,
details: response
});
})
.catch(function onRejected(reason) {
log.debug({
title: ‘Invalid Get Request: ‘,
details: reason
});
})
This is a cached copy. Click here to see the original post. -
September 20, 2016 at 9:53 am #1788
david.smithWhat error are you getting?
-
September 20, 2016 at 11:04 am #1789
davidturtonorg.mozilla.javascript.EcmaError: TypeError: Cannot find function promise in object function (options, headers) {…}.
-
September 20, 2016 at 11:33 am #1790
david.smithYour options are not formatted as and object.
https.get.promise({ url: ‘http:s//www.testwebsite.com’ })
-
September 20, 2016 at 1:46 pm #1791
chanarbonHI @davidturton,
Aside from the that there is a problem on your formatting, I think you are performing the Promise for https module on the server side. Please note that Promise API and Promise object is currently limited to client side. As of the moment, server side scripts are limited to the synchronous processes unlike client script which is user facing. Please check out SuiteAnswers ID 43804 (https://netsuite.custhelp.com/app/an…il/a_id/43804/) for more information.
-
September 23, 2016 at 7:37 am #1792
ironsideI don’t consider that a limitation at all. Look at how much messier that promise-based code is vs. the simple synchronous version.
I don’t want server-side promises at all unless there is a distinct advantage to the developer.
Originally posted by chanarbon
View Post
Aside from the that there is a problem on your formatting, I think you are performing the Promise for https module on the server side. Please note that Promise API and Promise object is currently limited to client side. As of the moment, server side scripts are limited to the synchronous processes unlike client script which is user facing.
-
AuthorPosts
You must be logged in to reply to this topic.