HTTP Service returns Invalid URL

Hey there, so I am currently working on a Discord Activity Bot.
However, I am now facing a big problem.

Roblox doesn’t want to send the Data to my Webserver because of an “invalid URL”.
This doesn’t make too much sense for me, as the URL itself should be valid. ( I tested it sending the same data with other tools such as Postman and there I had no problems)

How does Roblox validate if the URL is “valid”? Or do I have to change something on my Script?

Script I am currently using
local Players = game:GetService("Players")
local http = game:GetService("HttpService")
local url = "http://Username:Password@656a918bed38.ngrok.io/up"

Players.PlayerRemoving:Connect(function(plr)
	print("User left the Game, sending Data..")
	local Time = plr:WaitForChild("Time").Value
	
	local secs = Time
	local mins = 0
	while secs >= 60 do
		secs = secs - 60
		mins = mins + 1 
	end
	print(mins)
	local SendDataV = 
		{
		["userid"] = plr.UserId,
		["username"] = plr.Name,
		["playtime"] = mins
		
	}
	local NewSendDataV = http:JSONEncode(SendDataV)
	http:PostAsync(url, NewSendDataV)
	print("Data send!")
end)
2 Likes

URL "http://Username:Password@656a918bed38.ngrok.io/up" doesnt return nothing.
Make sure its running and not in a localhost :

Failed to complete tunnel connection
The connection to http://656a918bed38.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:3005.

Make sure that a web service is running on localhost:3005 and that it is a valid address.

The error encountered was: dial tcp [::1]:3005: connectex: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.

This is what returns the URL

1 Like

Once I enter the correct Username and Password (and not just Username:Password) I am coming through to my Web server.
image
(Can’t get anything because it is only supposed to upload Stuff on that webpage)

@Lp_Zombie HI, were you able to fix it?

1 Like

Yeah, it turns out that Roblox doesn’t like to have the login credentials to be in the URL.
I re-scripted parts of my webserver, and send the credentials over the headers.
As soon as I removed the Credentials out of the URL Roblox accepted the URL and my authentication worked.