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

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

# According to RFC-7230, for HTTP response status we use "status reason"
# instead of status text or status message.

global.web = {}
web.request = (options) ->
    method = options.method
