HttpError: NetFail when trying to fetch url HttpService

Hello! I am working on a game and I would like to show the server location, however the script below gives me a HttpError: NetFail on line 2. Http requests are enabled for my game and I was wondering what was causing this issue as I couldn’t find anything else on the devforms about this. Thanks!

local link = "https://api4.my-ip.io/v2/ip.json" local req = game:GetService("HttpService"):GetAsync(link) local json = game:GetService("HttpService"):JSONDecode(req) 
1 Like

Seems to just be an issue with that specific api as it wouldn’t work for me either no matter what, but switching to a different api worked - http://ip-api.com/json/

1 Like

you might wanna add a pcall because http requests can and do fail a lot

1 Like

For some reason, the link that I provided works on the browser but not in roblox. I tried the one you provided and it works! Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.