           xhr.setRequestHeader(key, requestMap.headers[key])
                }
            }
        }

        function objectToString(obj) {
            let arr = [];
            for (var k in obj) {
                arr.push(`${k}=${obj[k]}`);
            }

            return arr.join('&');
        }

        let qs = objectToString(params.data);

        let accessToken = window.localStorage.getItem(tokenKey);

        if (params.method.toUpperCase() == 'GET') {
            xhr.open('GET', params.url +