Hi, basically I’m trying to access my API in my Roblox game - it worked a while ago (maybe 2 months) but when coming back to work on the project again it is not working, and I get “HttpError: NetFail” shown in output. The API request works in studio, but not in-game.
I have tried creating a new studio, requesting data from the api via a get request individually, with still the same outcome. I have also tried changing port to 3000 (as I know there was a port restriction on a Roblox update), as well as updating the TLS minVersion on my express api (to 1.2). This just resulted in the same error.
Additionally, I have also tried sending GET requests via postman and it fetches the data successfully. I have looked over the most recent updates to http service and cannot seem to find anything else which may be relevant to this breakage.
My code is functional as I’ve tried it with other API requests (and it also works in studio) - so I’m wondering if there is another aspect I’ve missed out which will allow this to be resolved?
Thank you
Edit, the code I use when sending get requests:
function DataService.get(data_type, action_type, arguments, bypass_decode)
local FormattedUrl = DataService:_formatUrl(data_type, action_type, arguments)
local data
local decoded_data
local success,error= pcall(function()
data = HttpService:GetAsync(FormattedUrl)
if not bypass_decode then
decoded_data = HttpService:JSONDecode(data)
end
end)
local ArgumentFormatted = table.concat(arguments, ",")
if success then
warn("[DataService] -> Got type: "..data_type..", with action: "..action_type..". Url Arguments: "..ArgumentFormatted)
if bypass_decode then
return true
else
return decoded_data
end
else
print(error)
warn("[DataService] [ERR] -> Couldn't get type: "..data_type..", with action: "..action_type..". Url Arguments: "..ArgumentFormatted)
return false
end
end
I’m using postman which is an external website to check if my api is functional, and it is fetching data successfully, but I’m wanting to get the data from Roblox via http service.
If this is happening across many games, this could be a temporary service disruption. Other than that, check to make sure you allowed HTTP requests in game settings.
I’m using a custom API I built with express (with node js). I have a feeling it doesnt work in roblox games because of some security update - however I’ve updated the tls version and port so not sure what else to try. It works in studio perfectly fine (with http requests enabled)
I’m unsure if this is related, but the sample code for POST requests from the HttpService documentation page also works fine in Studio but throws a 403 Forbidden error when run in play mode.
Hey there, same problem for me. I have my own API and it works only in some servers (and when it works, only for a short period of time). We only get HttpError:NetFail, which means that the request doesn’t even get processed.
After investigating it appears that HTTPS requests on ports other than 443 will fail in some situations. We recommend using only port 443 for HTTPS requests for now. We will update if/when this restriction has been eliminated.