aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/tau/api.cljs
blob: e69bc9c05cda2645c46d36783fe94f199bb19c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(ns tau.api
  (:require
   [ajax.core :as ajax]))

(defn get-request
  ([uri on-success on-failure]
   (get-request uri on-success on-failure {}))
  ([uri on-success on-failure params]
   {:http-xhrio {:method :get
                 :uri uri
                 :params params
                 :format (ajax/json-request-format)
                 :response-format (ajax/json-response-format {:keywords? true})
                 :on-success on-success
                 :on-failure on-failure}}))