HttpService POST Request Delayed for 30s - 5m

What do you want to achieve?

i want to send RequestAsync ( Post ) Faster or at least with a fixed Delay ( 5s - 30s )

What is the issue?

It takes about 1 - 3 minutes to send my data ( 30s - 5m sometimes )
Some tests and images on the problem :point_down:
image
image
image
I did not change anything in the script except the message in the print
( First Line is Before and Second is After )
What solutions have you tried so far?

Tried to Search Google and the dev forum but only found one Topic ( DevFourm ) without Any solution

More Info

Hi , i’m using MongoDb ( A cloud database ) to send and read data from roblox
Yes i’m sure the problem isn’t from MongoDb or from my code or my internet Because i have tried to send the same data with the same code ( almost ) in another way

	local ejson_Body = HttpService:JSONEncode(db_info)
	
	local Before = "Beffore Sending Data [ "..DateTime.now():FormatLocalTime("hh:mm:ss","en-us").." ]"

	local Test -- Ignore
    --  Ignore ↓ ( responseJsonString ) these are just for debugging
	local responseJsonString, success, errorMessage = pcall(function()
		Test =  HttpService:RequestAsync({
			Url=url,
			Method="POST",
			Headers={
				["apiKey"]= apiKey,
				["Content-Type"]= "application/ejson",
				["Accept"]= "application/json",                
			},
			Body=ejson_Body,
		})

	end)
	local After = "After Sending Data [ "..DateTime.now():FormatLocalTime("hh:mm:ss","en-us").." ]"
	warn("1 ) "..Before)
	warn("2 ) "..After)

I really hope anyone knows how to fix this :pray: , thanks in advance and sorry if there is any grammatical error

2 Likes

I’d recommend using 000webhost, I host my SQL database and my json library on it. Post requests are received instantly, for reading them tho, do it once every 5 seconds so you don’t waste your requests

is there no other way to make it send faster ? my ping is 50ms and internet isn’t rly slow

Thx a lot for the recommendation .
I will try to search more for a solution if didn’t find any I will try ( to learn ) your recommendation

I can make you a video or a text tutorial, it’ll just take some time. I have all the scripts I used to make it on hand, I’ll send you the code to translate sql into json. You know how to export and import a SQL database right? If you get an authorization error, edit the sql data with notepad and replace some of the credentials

1 Like

fixed the problem >> it was from roblox studio
after I tester it in game it the request was sent without any delay
( First Line is Before and Second is After )

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