This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Creator's profile picture

Having trouble with http api.

Started by Creator, 07 February 2016 - 08:46 PM
Creator #1
Posted 07 February 2016 - 09:46 PM
I tried running this code a LOT of times and it is not working.

When I replace the URL with "http://google.com" or "http://example.com" it works normally.

When running the code locally (from a file on the PC) it still does not work.

I even restarted my physical laptop to be sure it is not an issue with the laptop.

Thanks for the help in advance.

PS: For those to lazy to click on the link, here is the code:


--[[
    Updater Script
]]--

local path = ...
print(path)
print("lelz")

local handle = http.get("https://raw.githubusercontent.com/Creator/Tunnel/master/Releases/latest.lua")
local f = loadstring(handle.readAll())
print(handle.readAll())
setfenv(f,_G)
f(path)

And make sure to make me feel like an idiot when you discover the issue.
Lupus590 #2
Posted 07 February 2016 - 10:06 PM
could the https be causing the problem?
Creator #3
Posted 07 February 2016 - 10:26 PM
I think I tried it both ways. it turns out the s does matter. Thanks.
Lignum #4
Posted 07 February 2016 - 10:50 PM
Where are you testing this? HTTPS works fine for me on CCEmuRedux.
Creator #5
Posted 07 February 2016 - 11:37 PM
Normal CC.
HPWebcamAble #6
Posted 07 February 2016 - 11:40 PM
What is not working? What does it do?
Creator #7
Posted 07 February 2016 - 11:42 PM
Well, it works now. It turns out the s in https is very important.