v2 object issues
Posted: 25 Aug 2023, 20:48
In my http request to access an important API, I need to send in a JSON object with header: { x-api-key : "myapikey"}
I've always built the object in AHK first and then parsed it into JSON with a function.
New AHKv2 decided that 'x-api-key' is an 'Invalid property name in object literal'.
Come on... that's crazy. I need to be able to make an object with a '-' in the key name. Can this be fixed or will I be forever using AHK v1?
I'm doing everything I can to make a workaround... still no luck... It's giving me errors that make zero sense.
Error: This value of type "Object" has no property named "__Item".
003: p := {}
▶ 004: p["x-api-key"] := 1
006: MsgBox(p["x-api-key"])
008: ExitApp()
I've always built the object in AHK first and then parsed it into JSON with a function.
New AHKv2 decided that 'x-api-key' is an 'Invalid property name in object literal'.
Come on... that's crazy. I need to be able to make an object with a '-' in the key name. Can this be fixed or will I be forever using AHK v1?
I'm doing everything I can to make a workaround... still no luck... It's giving me errors that make zero sense.
Error: This value of type "Object" has no property named "__Item".
003: p := {}
▶ 004: p["x-api-key"] := 1
006: MsgBox(p["x-api-key"])
008: ExitApp()