encodeParams(obj, prefix = '') {
        let str = ''
        Object.keys(obj).forEach(key => {
            if (str != '') str += '&'
            if (typeof obj[key] == 'object') {
                str += this.encodeParams(obj[key], prefix + key + (prefix ? ']' : '') + '[')
            } else {
                str += `${prefix}${key}${prefix ? ']' : ''}=${obj[key]}`
            }
        })
        return str
    }
Takes an object and encodes it into params string to be passed as a url
{ a: 1, b: 'str'}                => "a=1&b=str"
{ a: 1, b: { c: 2 }}             => "a=1&b[c]=2"
{ a: 1, b: {c: { k: 'dfdf' } } } => "a=1&b[c][k]=dfdf"