   (>= status 400))
 
 (defn- handle-response
-  [on-success on-error e]
-  (let [response {:id     (.-id e)
+  [on-success on-error id e]
+  (let [response {:id     id
                   :body   (. e/currentTarget (getResponseText))
                   :status (. e/currentTarget (getStatus))
                   :event  e}

           content
           (when headers (.-strobj headers))
           priority
           (partial handle-response on-success on-error)
           retries)
    (catch js/Error e
      nil)))

(defn url
  [path]
  (str (.-origin (.-location js/document)) path))

  Other allowable keyword arguments are `:method`, `:content`, `:headers`,
  `:priority`, and `:retries`. `:method` defaults to \"GET\" and `:retries`
  defaults to `0`.

  `priority` defaults to 100. The lower the number the higher the priority."
  [id url & {:keys [method content headers priority retries
                    on-success on-error]
             :or   {method   "GET"
