(create-http-methods ks)creates the standard http get, post, etc requests
creates the standard http get, post, etc requests
(delete url)(delete url opts)(endpoint-data result)gets the data returned from endpoint
(endpoint-data {:status 200 :body (str {:data [1 2 3 4] :status :return})}) => [1 2 3 4]
gets the data returned from endpoint
(endpoint-data {:status 200
:body (str {:data [1 2 3 4]
:status :return})})
=> [1 2 3 4](get url)(get url opts)(getter-methods cls)returns methods of one argument
(keys (getter-methods java.net.http.HttpResponse)) => [:body :headers :previous-response :request :ssl-session :status-code :uri :version]
returns methods of one argument
(keys (getter-methods java.net.http.HttpResponse))
=> [:body :headers :previous-response :request
:ssl-session :status-code :uri :version](head url)(head url opts)(http-client)(http-client opts)constructor for java.net.http.HttpClient
(http-client) => java.net.http.HttpClient
constructor for java.net.http.HttpClient (http-client) => java.net.http.HttpClient
(http-client-builder)(http-client-builder opts)constructor for java.net.http.HttpClientBuilder
(http-client-builder) => java.net.http.HttpClient$Builder
constructor for java.net.http.HttpClientBuilder (http-client-builder) => java.net.http.HttpClient$Builder
(http-request req)(http-request req
method
{:keys [expect-continue? headers timeout version body] :as opts})constructor for java.net.http.HttpRequest
(http-request "http://www.yahoo.com") => java.net.http.HttpRequest
constructor for java.net.http.HttpRequest (http-request "http://www.yahoo.com") => java.net.http.HttpRequest
(http-request-builder opts)constructor for java.net.http.HttpRequestBuilder
(http-request-builder {:uri "http://www.yahoo.com"}) => java.net.http.HttpRequest$Builder
constructor for java.net.http.HttpRequestBuilder
(http-request-builder {:uri "http://www.yahoo.com"})
=> java.net.http.HttpRequest$Builder(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?})(request-body body)constructs a relevant body publisher
(request-body "") => java.net.http.HttpRequest$BodyPublisher
constructs a relevant body publisher (request-body "") => java.net.http.HttpRequest$BodyPublisher
(request-headers headers)constructs a relevant request header
(vec (request-headers {"Content" "html" "Tags" ["a" "b" "c"]})) => ["Content" "html" "Tags" "a" "Tags" "b" "Tags" "c"]
constructs a relevant request header
(vec (request-headers {"Content" "html"
"Tags" ["a" "b" "c"]}))
=> ["Content" "html"
"Tags" "a" "Tags" "b" "Tags" "c"](response-map resp)constucts a map from java.net.http.HttpResponse
constucts a map from java.net.http.HttpResponse
(wrap-get-optional f)wraps function, nil-punning outputs for java.util.Optional
((wrap-get-optional identity) (java.util.Optional/of "hello")) => "hello"
wraps function, nil-punning outputs for java.util.Optional ((wrap-get-optional identity) (java.util.Optional/of "hello")) => "hello"
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 |