http.Fetch not working?


http.Fetch( "http://fastdl.sweepy.pw/version.html",
	function( body, len, headers, code )
		RASVersion = body
	end,
	function( error )
	end
 )

That URL does indeed accept GET requests, however it is returning nil. What is going on?

[lua]http.Fetch( “http://fastdl.sweepy.pw/version.html”,
function( … )
PrintTable({ … })
end,
function( error )
end
)[/lua]

What does that show you?

[editline]16th April 2016[/editline]

Upon testing, it seems that it works for me. Your server could be blocking connections to that website. Possibly a firewall?

So this is weird.


http.Fetch( "https://raw.githubusercontent.com/sweepyoface/revo-admin-stick/master/VERSION.html",
	function( body )
		stickver = body
		localstickver = "4.00"
		if localstickver != stickver then
			print("Revo Admin Stick is outdated! The newest version is " .. tostring(stickver) .. " and you are still on version " .. tostring(localstickver))
		else
			print("Revo Admin Stick is up to date with version " .. tostring(localstickver))
		end
		print(stickver)
		print(localstickver)
	end,
	function( error )
	end
 )

gives me


Revo Admin Stick is outdated! The newest version is 4.00
 and you are still on version 4.00
4.00

4.00


For some reason it is putting an extra line below what it fetches.

Your website might have a new line below it. Use string.Trim on the versions to remove that.

Thanks, the trim worked.