• http.Fetch not working?
    4 replies, posted
[CODE]http.Fetch( "http://fastdl.sweepy.pw/version.html", function( body, len, headers, code ) RASVersion = body end, function( error ) end )[/CODE] 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?
[QUOTE=BillyOnWiiU;50139712][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?[/QUOTE] So this is weird. [CODE]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 )[/CODE] gives me [CODE]Revo Admin Stick is outdated! The newest version is 4.00 and you are still on version 4.00 4.00 4.00 [/CODE] 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.
[QUOTE=BillyOnWiiU;50142175]Your website might have a new line below it. Use string.Trim on the versions to remove that.[/QUOTE] Thanks, the trim worked.
Sorry, you need to Log In to post a reply to this thread.