(delete url)(delete url opts)(get url)(get url opts)(handler x)constructs handler from
((handler [[:get "/hello" (constantly "hello")] [:post "/hello" (constantly "hello post")]]) {:method :post :route "/hello"}) => "hello"
constructs handler from
((handler [[:get "/hello" (constantly "hello")]
[:post "/hello" (constantly "hello post")]])
{:method :post
:route "/hello"})
=> "hello"(head url)(head url opts)(html rep)converts either node or tree representation to a html string
(html [:body [:div "hello"] "world"]) => "<body>\n <div>hello</div>world\n</body>"
converts either node or tree representation to a html string (html [:body [:div "hello"] "world"]) => "<body>\n <div>hello</div>world\n</body>"
(mock-endpoint handler route)(mock-endpoint handler route {:keys [format] :or {format :edn}})creates a mock-endpoint for testing
((mock-endpoint (fn [req] {:status 200 :body (str {:status :return :data req})}) "/endpoint") {:id :add :args [1 2 3]}) => {:method :post, :route "/endpoint", :body "{:id :add, :args [1 2 3]}"}
creates a mock-endpoint for testing
((mock-endpoint (fn [req] {:status 200
:body (str {:status :return
:data req})}) "/endpoint")
{:id :add
:args [1 2 3]})
=> {:method :post, :route "/endpoint", :body "{:id :add, :args [1 2 3]}"}(patch url)(patch url opts)(post url)(post url opts)(put url)(put url opts)(remote url {:keys [id args format] :as opts :or {format :edn}})creates a remote access to an endpoint
creates a remote access to an endpoint
(request req)(request uri
{:keys [client as raw type callback error method]
:as opts
:or {type :sync as :string method :get client +default-client+}})performs a http request
(request "http://www.yahoo.com") => (contains {:status number? :body string? :version "HTTP_1_1" :headers map?})
performs a http request
(request "http://www.yahoo.com")
=> (contains {:status number?
:body string?
:version "HTTP_1_1"
:headers map?})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |