(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 req
{: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?})
(run-server handler
{:keys [host port dispatch?]
:or {host "localhost" port 80 dispatch? true}
:as options})
Start an Undertow webserver to serve the given handler according to the supplied options:
:configurator - a function called with the Undertow Builder instance :port - the port to listen on (defaults to 80) :host - the hostname to listen on :io-threads - number of threads to use for I/O (default: number of cores) :worker-threads - number of threads to use for processing (default: io-threads * 8) :dispatch? - dispatch handlers off the I/O threads (default: true)
Returns an Undertow server instance. To stop call (.stop server).
Start an Undertow webserver to serve the given handler according to the supplied options: :configurator - a function called with the Undertow Builder instance :port - the port to listen on (defaults to 80) :host - the hostname to listen on :io-threads - number of threads to use for I/O (default: number of cores) :worker-threads - number of threads to use for processing (default: io-threads * 8) :dispatch? - dispatch handlers off the I/O threads (default: true) Returns an Undertow server instance. To stop call (.stop server).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close