         body : if typeof(data) == "string" then data else data.serialize()
         headers :
           "Content-Type" : "application/x-www-form-urlencoded"
-      (response) ->
-        response.json()
+      @handleEmptyJsonResponse
     )
 
 

      )
    else
      Toast.error(error)
      Promise.reject(error)


  # Extends the native Promise API with `always` functionality similar to jQuery.

        body : if typeof(data) == "string" then data else JSON.stringify(data)
        headers :
          "Content-Type" : "application/json"
      @handleEmptyJsonResponse
    )


