Skip to main content
Participating Frequently
April 2, 2019
Question

Error called get request

Hi, I'm trying to send a GET request with Net.HTTP.request to http://dummy.restapiexample.com/ , actually I'm calling this endpoint: http://dummy.restapiexample.com/api/v1/employee/7052

No matter what I try I always get this error:

NotAllowedError: Security settings prevent access to this property or method.

It's a js which is being called at document level, improved security is disabled and I've also tried enabling it.

the code is -->

//<Document-Level>

//<ACRO_source>Init</ACRO_source>

//<ACRO_script>

/**** pertenece a: Document-Level:Init ****/

myTrustedFunction = app.trustedFunction(

    function()

    {

        this.getField("textAJAX").display = display.hidden;

        console.println("2 - ");

        Net.HTTP.request({

            cVerb: 'GET',

            cURL: 'http://dummy.restapiexample.com/api/v1/employee/7052',

            oHandler: {

                response: function(msg, uri, err) {

                    if (err != undefined) {

                        app.alert(msg)

                    } else {

                        console.println("1");

                        var stream = msg;

                        console.println(stream);

                    };

                }

            }

        });

    }

);

//</ACRO_script>

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Legend
April 3, 2019

Did you observe the special note for the Net.HTTP.request method? This does not seem to meet the requirements. Also, make sure you're NOT using Reader.

Translate