Error called get request

Community Beginner ,
Apr 02, 2019

Copy link to clipboard

Copied

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>

TOPICS
Acrobat SDK and JavaScript

Views

287

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Error called get request

Community Beginner ,
Apr 02, 2019

Copy link to clipboard

Copied

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>

TOPICS
Acrobat SDK and JavaScript

Views

288

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 02, 2019 0
Most Valuable Participant ,
Apr 02, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 02, 2019 1