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

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()

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