                             JSON.parse(xhr.response)
                         else
                             fail()
-                    getHeader: (name) -> xhr.getResponseHeader(name)
-                if (200 <= xhr.status < 300)
+                if (200 <= response.statusCode < 300)
                     resolve(response)
                 else
                     reject(response)

            xhr.ontimeout = ->
                reject(new Error("timeout"))
            xhr.send(body)
        else
            http = module.require("http")
            http.get(url, (res) ->
                console.log("Got response: " + res.statusCode)
            ).on("error", (e) ->
                console.log("Got error: " + e.message)
            )
    )
web.get = (url, options) ->
    actualOptions =

            xhr.onload = ->
                response =
                    statusCode: xhr.status
                    statusReason: xhr.statusText
                    headers:
                        xhr.getAllResponseHeaders()
                        .stripTrailingNewline()
                        .splitDeep("\r\n", ": ", 1)
                        .map((header) -> [header[0].toLowerCase(), header[1]])
                        .toObject()
                    body:
                        if responseBodyType == "binary"
