server-side json decode

Hi dev,

Whenever i try to json.decode tables on the server i get error, string expected.

The exact same thing works fine on client side.

This is a major issue for me as I need to handle a lot of json tables server-side.

Any ideas?

anaqim

EDIT code goes like this:

local response,err=core.network.request(url,{method=“GET”,headers=headers})

local dcode=core.json.decode(response)

Ops! found your core.network.getJson and solve it :slight_smile:

Hi,

As far as the request style, you should be looking at the body key of the response.

local dcode = core.json.decode(response.body)

-dev

Ops! found your core.network.getJson and solve it :slight_smile:

Hi,

As far as the request style, you should be looking at the body key of the response.

local dcode = core.json.decode(response.body)

-dev