#HttpService not working?

1 messages · Page 1 of 1 (latest)

fallow tide
#

I think fetching information from roblox api works on local scripts, right?
so why doesnt this work?

local http = game:GetService("HttpService")

local function updateGUI(name)
    local maxtries = 3
    local tries = 0
    local success, response
    print("httpenabled: " .. tostring(http.HttpEnabled))
    repeat
        tries += 1
        success, response = pcall(function()
            http:GetAsync("https://games.roblox.com/v1/games?universeIds=" .. name)
        end)
        
        if not success then
            warn("didnt work on try" .. tostring(tries) .. " because " .. response)
        end
    until success or tries >= maxtries
    return success, response
end

local list = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("List"):WaitForChild("List")
for _, v in pairs(list:GetChildren()) do
    if v:IsA("Frame") then
        local success, response = updateGUI(v.Name)
        if success then
            local decoded, json = pcall(function()
                return http:JSONDecode(response)
            end)
            local text = list:FindFirstChild(tostring(v)).GameName
            if decoded and json and json.data and json.data[1] then text.Text = json.data[1].name 
            else text.Text = "Failed to load game"
            end
        end
    end
end

http requests are on, and sudio access to api services is enabled
yet the console outputs "httpenabled: false"
and warns "didnt work on try1 because Http requests can only be executed by game server"
can anyone help?

prime shadow
fallow tide
#

chatgpt lied to me wth

wide geyser
fallow tide
#

lol ok

fallow tide
#

also for some reason i cant access that roblox resource (https://games.roblox.com) when i do put it in a serverscript and use a remote function

desert girderBOT
#

studio** You are now Level 3! **studio

acoustic adder
#

u can't use http:GetAsync cuz if u could you can just fetch people's IPs and stuff

#

use the server for HTTP requests

fallow tide
#

i forgot to tag this a s solved

#

found out u could do the same thing by using marketplace service