I’m trying to use the OpenWeatherMap API in roblox but I keep getting “Invalid URL type, URL should be a string or secret.” on line 4 of my server script.
Local script:
script.Parent.MouseButton1Click:Connect(function()
local baseUrl = "http://api.openweathermap.org/data/2.5/weather?"
local apiKey = "<APIKEY>"
local city = "London"
local url = baseUrl.."appid="..apiKey.."&q="..city
game.ReplicatedStorage.Events.ShareData:FireServer(url)
end)
Server script:
game.ReplicatedStorage.Events.ShareData.OnServerEvent:Connect(function(url)
local httpService = game:GetService("HttpService")
print(url)
local response = httpService:GetAsync(url)
print(response)
end)