HttpService requests yields forever, even when server sends data back

HttpService:RequestAsync() will yield extremely long even if the external server sends back information. This example uses Parcel’s API to fetch the roblox users’ information, and if you put the link in your brower, it’ll fetch it almost immediately without delay.

Reproduction Code Example
This code does not have to be put in a header, which the main reason why I used this one and not our other ones.

Please keep in mind, this example uses GetAsync() and RequestAsync because most of our other endpoints are blocked with hub secret keys, which only can be obtained by our customers.

local HttpService = game:GetService("HttpService")

local function sendRequest()
	local res = HttpService:RequestAsync({
		Url = "https://api.parcelroblox.com/api/user/check/225887981?option=roblox", 
		Method = "GET"
	})

	if res.StatusCode == 200 then 
		return HttpService:JSONDecode(res.Body)
	else 
		warn("Hub Request Failed:", res.StatusCode, res.StatusMessage)
		return false
	end
end

local function sendRequest2()
	local res = HttpService:GetAsync({
		Url = "https://api.parcelroblox.com/api/user/check/225887981?option=roblox"
	})

	print(res.StatusCode)
	if res.StatusCode == 200 then 
		return HttpService:JSONDecode(res.Body)
	else 
		warn("Hub Request Failed:", res.StatusCode, res.StatusMessage)
		return false
	end
end

game.Players.PlayerAdded:Connect(function(player)
	print("got player added here")
	print(sendRequest())
	
	
	--print(sendRequest2())
end)


Expected behavior

Usually, when the player joins and/or the script starts, this request will go through and now, it’s taking so long which hinders our services even more.

1 Like

This is still happening, and I’m not sure what’s going on.

Simpler example code:

local HttpService = game:GetService("HttpService")

local success, result = pcall(function()
	return HttpService:RequestAsync({
		Url = "https://api.parcelroblox.com/api/user/check/225887981?option=roblox", 
		Method = "GET"
	})
end)

if success then
	print(success)
else
	warn(result)
end

Is this only occurring in Studio and / or do you have any plugins installed? Roblox limits all of Studio to 500 requests/min and only 3 concurrent in-flight requests; this massively delays other requests in these scenarios.

This is happening in-game (roblox application game) and play testing in Studio. With this example, it’s not even working.

Thanks for the report! Just to confirm, we have a ticket filed and we’ll follow up when we have an update for you.

1 Like

I have been trying the two code samples you posted - seems I could get the response pretty quick with HttpService calls, is it still happening for you?

It seemed to be happening only on one place, and works on other places. The only other issue that I wasn’t aware of is you are only to have 3 ongoing HttpService requests which for us is kinda impossible which is unrelated to this incident.

1 Like

Yes 3 ongoing requests is expected.
I checked our changelog and don’t see any recent changes related with this incident. Let us know any clue you have on the not working place so we could debug it further!

2 Likes