include("import") func doGet(_data) fvar(cc, hh, ua, ref) need_httplib() cc = Cookies hh = Headers ua = UserAgent ref = Referer if (linked(Connection)) conn_ = Connection else if (Protocol == 0) println(conn_, ' = httplib.HTTPConnection(', Host, ', ', Port, ')') else println(conn_, ' = httplib.HTTPSConnection(', Host, ', ', Port, (isndef(Key)?(', ' && Key):''), (isndef(Cert)?(', ' && Cert):''), ')') end println(conn_, '.connect()') end if (isndef(hh)) println(hs, ' = ', hh) else println(hs, ' = {}') if (isndef(cc)) //headers & cookies println('if ("Cookie" in ', hs, '):') block.inclvl() println(hs, '["Cookie"] += ', cc) block.declvl() println('else:') block.inclvl() println(hs, '["Cookie"] = ', cc) block.declvl() end println(hs, '["User-Agent"] = ', ua) if (isndef(ref)) println(hs, '["Referer"] = ', ref) end println(req, ' = ', conn_, '.request("GET", ', Url, ', headers=', hs, ')') event(onGet, req && '.status') end func Conn() return(conn_) end func RespHeaders() return ((req && '.getheaders()')@PyList) end func RespData() return(req && '.read()') end