Put fetch inside your Wally dependencies, as so:
fetch = "synpixel/[email protected]"
fetch("https://dummyjson.com/products/1")
:andThen(function(response: fetch.Response)
local product = response.json():expect()
print(product)
end)
:catch(function(response: fetch.Response)
warn("Failed to fetch data")
end)
fetch("https://rojo.space/img/logo.png")
:andThen(function(response: fetch.Response)
local image = response.image():expect()
print(image.Width, image.Height)
end)
:catch(function(response: fetch.Response)
warn("Failed to fetch data")
end)