unexpected error message - I have tried everything I could think of as a new developer to fix it

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AidanCoding

extends Node

var token
var player_id

func authenticate_guest_session():
var url = “https://api.lootlocker.io/game/v2/session/guest
var header = [“Content-Type: application/json”]
var method = HTTPClient.METHOD_POST
var request_body = {
“game_key” : “inerteasdfsgfdsg”,
“game_version” : “2.1.0”,
“player_identifier” : player_id,
“development_mode” : true
}
request(url, header, false, method, to_json(request_body))

→ var response = await(self,“request_completed”)[3]
response = JSON.parse(response.get_string_from_utf8()).result
if “session_token” in response:
token = response[“session_token”]

Here are my error messages:
Line 18:Expected closing “)” after grouping expression.
Line 18:Expected end of statement after variable declaration, found “,” instead.

I marked line 18 with a “>” for you all

Is this something new to Godot 4? I was watching an older tutorial of Godot which I thought I could use.

Your code isn’t readable. When you post it, click the “Code Sample” button to format it correctly.

kidscancode | 2023-04-03 03:23

:bust_in_silhouette: Reply From: Enfyna

I dont think you are using await correctly. I think it should be something like this :

var response = await self.requestcompleted