Getting a JSON value from an url, using PerformHttpRequest

Hello, the title says it all. I have found posts about how to SEND data, but couldn’t find posts about how to GET data. I’d love to see an example on this, thanks in advance :slight_smile:

Just json.decode the returned data?

PerformHttpRequest("http://myamazingurl", function(err, data, headers)
    local myData = json.decode(data)
end, "GET", "")

or so perhaps?

When you send a http request, it’ll return whatever is printed onto the page on the other end. So, for example, if you have ‘test.json’ on a webserver and httprequest to it, it would return the data in the ‘data’ parameter of the function if the request was succesful.

As @d0p3t suggested, you can then decode the json data with json.decode() in order to access it as a table :slight_smile:

Yep, I figured it out right after posting the topic, but thank you guys for the answers <3