 
 (defonce conf (atom nil))
 
-(defn post [url params]
-  (logging/debug post [url params])
+
+;### Http request #############################################################
+
+(defn- request [method url params]
+  (logging/debug [method url params])
   (let [basic-auth (:basic_auth @conf)]
     (with/logging
       (logging/debug "http/post" {:url url :basic-auth basic-auth})
-      (http-client/post 
-        url
+      (http-client/request
         (conj {:basic-auth [(:user basic-auth) (:secret basic-auth)]
+               :url url 
+               :method method
                :insecure? true
                :content-type :json
                :accept :json 

       (-> @conf (:basic_auth) (:secret)))
    (keyword application)))


(defn authenticate [handler]
   (wrap-basic-authentication handler authenticated?))



               :conn-timeout 1000 }
              params)))))

(defn post [url params]
  (logging/debug post [url params])
  (request :post url params))

(defn put [url params]
  (logging/debug put [url params])
  (request :put url params))

(defn patch [url params]
  (logging/debug patch [url params])
   (request :patch url params))


;### Http Basic Authentication ################################################
