Home Ext.data.Connection.override request
Reply: 0

Ext.data.Connection.override request

user1049
1#
user1049 Published in June 20, 2018, 1:24 am

I am trying to intercept all requests, before send, from an Extjs App, POST and GET and then manipulate the URL and add a new Header, Authorization: Bearer XYZ123.

I've this code:

Ext.data.Connection.override({

    request: function (options) {
        var me = this;

        this.cors = true;
        this.useDefaultHeader = false;
        this.useDefaultXhrHeader = false;

        options.headers = { "Authorization": "Bearer VAROIS1iOiJKV1QiLCJh" };

        var separator = options.url.indexOf('/') == 0 ? "" : "/";
        options.url = UrlAPIPrefix + separator + options.url;

        return me.callOverridden(arguments);
    }
});

But when i try to use it, the Header Authorization is not sent in both cases, GET and POST. Parameters are not sent when using POST. I am able to see params if debugging the code into Extjs files, but can't see it on chrome Request Headers, see image.

If any one knows how to do it, in one place, i will be glad if you can help me.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.29965 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO