             fail()
         if mate.environmentType == "browser" then do ->
             xhr = new XMLHttpRequest()
-            xhr.open(method, url)
+            xhr.open(method, uri)
             if headers?
                 Object.forKeyValue(headers, (key, value) -> xhr.setRequestHeader(key, value))
             xhr.responseType =

web.request = (options) -> new Promise((resolve, reject) ->
    try
        method = options.method
        url = options.url
        headers = options.headers ? null
        body = options.body ? null
        timeout = options.timeout ? null
        responseBodyType = options.responseBodyType ? "text"
        if not method?
            fail()
        if not url?
            fail()
        if body? and typeof body != "string" and body not instanceof Uint8Array
            fail()

            http = module.require("http")
            https = module.require("https")
            urlMod = module.require("url")
            parsedUri = urlMod.parse(uri)
            httpOrHttps = if parsedUri.protocol == "https:" then https else http
            rawRequest = httpOrHttps.request(
                {
                    method: method
                    hostname: parsedUri.hostname
                    port: parsedUri.port
                    path: parsedUri.path
                    headers: headers
                },
                (rawResponse) ->
