Liking cljdoc? Tell your friends :D

hara.net.http.client


+default-client+clj


+getter-opts+clj


+http-redirect+clj


+http-response-handler+clj


+http-version+clj


+init+clj


create-http-methodscljmacro

(create-http-methods ks)

creates the standard http get, post, etc requests

creates the standard http get, post, etc requests 
raw docstring

deleteclj

(delete url)
(delete url opts)

endpoint-dataclj

(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]
raw docstring

getclj

(get url)
(get url opts)

getter-methodsclj

(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]
raw docstring

(head url)
(head url opts)

http-clientclj

(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
raw docstring

http-client-builderclj

(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
raw docstring

http-requestclj

(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
raw docstring

http-request-builderclj

(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
raw docstring

mock-endpointclj

(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]}"}
raw docstring

patchclj

(patch url)
(patch url opts)

postclj

(post url)
(post url opts)

putclj

(put url)
(put url opts)

remoteclj

(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
raw docstring

requestclj

(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?})
raw docstring

request-bodyclj

(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
raw docstring

request-headersclj

(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"]
raw docstring

response-mapclj

(response-map resp)

constucts a map from java.net.http.HttpResponse

constucts a map from java.net.http.HttpResponse
raw docstring

wrap-get-optionalclj

(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"
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close