var headers = ["Content-Type: application/json" , "Cookie:token" , "Cookie: device/browser"]
ws.connect_to_url(url,[],false,headers)
bonus:
Only solution i find for convert dictionnary variable to proper json for my server :
func fix_json(dict):
var result = "{"
var i = 0
for key in dict.keys():
if i > 0:
result += ","
i+= 1
if typeof(dict[key]) == TYPE_STRING:
result += '"' + key + '" : "' + dict[key] + '"'
continue
if typeof(dict[key]) == TYPE_INT:
result += '"' + key + '" : ' + str(dict[key])
continue
if typeof(dict[key]) == TYPE_DICTIONARY:
result += '"' + key + '" : ' + fix_json(dict[key])
continue
result += '"' + key + '" : ' + dict[key]
result += "}"
return result