Liking cljdoc? Tell your friends :D

java-http.core

Convenience functions for HTTP requests.

Provides HTTP convenience functions (get, post, put, delete, etc.) as a higher-level API on top of the lower-level client/send function.

All functions accept a URI and optional request map, and return the response as a Clojure map.

Convenience functions for HTTP requests.

Provides HTTP convenience functions (get, post, put, delete, etc.) as a higher-level
API on top of the lower-level client/send function.

All functions accept a URI and optional request map, and return the
response as a Clojure map.
raw docstring

connectclj

(connect uri)
(connect uri request-map)

Sends a CONNECT request to the specified URI.

Arity 1: (connect uri) Arity 2: (connect uri request-map)

The request-map is merged with method :connect and the given uri. Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a CONNECT request to the specified URI.

Arity 1: (connect uri)
Arity 2: (connect uri request-map)

The request-map is merged with method :connect and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

connect-asyncclj

(connect-async uri)
(connect-async uri request-map)

Sends a CONNECT request asynchronously to the specified URI.

Arity 1: (connect-async uri) Arity 2: (connect-async uri request-map)

The request-map is merged with method :connect and the given uri. Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a CONNECT request asynchronously to the specified URI.

Arity 1: (connect-async uri)
Arity 2: (connect-async uri request-map)

The request-map is merged with method :connect and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

deleteclj

(delete uri)
(delete uri request-map)

Sends a DELETE request to the specified URI.

Arity 1: (delete uri) Arity 2: (delete uri request-map)

The request-map is merged with method :delete and the given uri. Use the second arity to add headers, timeout, body, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a DELETE request to the specified URI.

Arity 1: (delete uri)
Arity 2: (delete uri request-map)

The request-map is merged with method :delete and the given uri.
Use the second arity to add headers, timeout, body, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

delete-asyncclj

(delete-async uri)
(delete-async uri request-map)

Sends a DELETE request asynchronously to the specified URI.

Arity 1: (delete-async uri) Arity 2: (delete-async uri request-map)

The request-map is merged with method :delete and the given uri. Use the second arity to add headers, timeout, body, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a DELETE request asynchronously to the specified URI.

Arity 1: (delete-async uri)
Arity 2: (delete-async uri request-map)

The request-map is merged with method :delete and the given uri.
Use the second arity to add headers, timeout, body, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

getclj

(get uri)
(get uri request-map)

Sends a GET request to the specified URI.

Arity 1: (get uri) Arity 2: (get uri request-map)

The request-map is merged with method :get and the given uri. Use the second arity to add headers, timeout, body, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a GET request to the specified URI.

Arity 1: (get uri)
Arity 2: (get uri request-map)

The request-map is merged with method :get and the given uri.
Use the second arity to add headers, timeout, body, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

get-asyncclj

(get-async uri)
(get-async uri request-map)

Sends a GET request asynchronously to the specified URI.

Arity 1: (get-async uri) Arity 2: (get-async uri request-map)

The request-map is merged with method :get and the given uri. Use the second arity to add headers, timeout, body, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a GET request asynchronously to the specified URI.

Arity 1: (get-async uri)
Arity 2: (get-async uri request-map)

The request-map is merged with method :get and the given uri.
Use the second arity to add headers, timeout, body, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

(head uri)
(head uri request-map)

Sends a HEAD request to the specified URI.

Arity 1: (head uri) Arity 2: (head uri request-map)

The request-map is merged with method :head and the given uri. Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a HEAD request to the specified URI.

Arity 1: (head uri)
Arity 2: (head uri request-map)

The request-map is merged with method :head and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

head-asyncclj

(head-async uri)
(head-async uri request-map)

Sends a HEAD request asynchronously to the specified URI.

Arity 1: (head-async uri) Arity 2: (head-async uri request-map)

The request-map is merged with method :head and the given uri. Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a HEAD request asynchronously to the specified URI.

Arity 1: (head-async uri)
Arity 2: (head-async uri request-map)

The request-map is merged with method :head and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

optionsclj

(options uri)
(options uri request-map)

Sends an OPTIONS request to the specified URI.

Arity 1: (options uri) Arity 2: (options uri request-map)

The request-map is merged with method :options and the given uri. Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends an OPTIONS request to the specified URI.

Arity 1: (options uri)
Arity 2: (options uri request-map)

The request-map is merged with method :options and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

options-asyncclj

(options-async uri)
(options-async uri request-map)

Sends an OPTIONS request asynchronously to the specified URI.

Arity 1: (options-async uri) Arity 2: (options-async uri request-map)

The request-map is merged with method :options and the given uri. Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends an OPTIONS request asynchronously to the specified URI.

Arity 1: (options-async uri)
Arity 2: (options-async uri request-map)

The request-map is merged with method :options and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

patchclj

(patch uri)
(patch uri request-map)

Sends a PATCH request to the specified URI.

Arity 1: (patch uri) Arity 2: (patch uri request-map)

The request-map is merged with method :patch and the given uri. Use the second arity to add body, headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a PATCH request to the specified URI.

Arity 1: (patch uri)
Arity 2: (patch uri request-map)

The request-map is merged with method :patch and the given uri.
Use the second arity to add body, headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

patch-asyncclj

(patch-async uri)
(patch-async uri request-map)

Sends a PATCH request asynchronously to the specified URI.

Arity 1: (patch-async uri) Arity 2: (patch-async uri request-map)

The request-map is merged with method :patch and the given uri. Use the second arity to add body, headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a PATCH request asynchronously to the specified URI.

Arity 1: (patch-async uri)
Arity 2: (patch-async uri request-map)

The request-map is merged with method :patch and the given uri.
Use the second arity to add body, headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

postclj

(post uri)
(post uri request-map)

Sends a POST request to the specified URI.

Arity 1: (post uri) Arity 2: (post uri request-map)

The request-map is merged with method :post and the given uri. Use the second arity to add body, headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a POST request to the specified URI.

Arity 1: (post uri)
Arity 2: (post uri request-map)

The request-map is merged with method :post and the given uri.
Use the second arity to add body, headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

post-asyncclj

(post-async uri)
(post-async uri request-map)

Sends a POST request asynchronously to the specified URI.

Arity 1: (post-async uri) Arity 2: (post-async uri request-map)

The request-map is merged with method :post and the given uri. Use the second arity to add body, headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a POST request asynchronously to the specified URI.

Arity 1: (post-async uri)
Arity 2: (post-async uri request-map)

The request-map is merged with method :post and the given uri.
Use the second arity to add body, headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

putclj

(put uri)
(put uri request-map)

Sends a PUT request to the specified URI.

Arity 1: (put uri) Arity 2: (put uri request-map)

The request-map is merged with method :put and the given uri. Use the second arity to add body, headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a PUT request to the specified URI.

Arity 1: (put uri)
Arity 2: (put uri request-map)

The request-map is merged with method :put and the given uri.
Use the second arity to add body, headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

put-asyncclj

(put-async uri)
(put-async uri request-map)

Sends a PUT request asynchronously to the specified URI.

Arity 1: (put-async uri) Arity 2: (put-async uri request-map)

The request-map is merged with method :put and the given uri. Use the second arity to add body, headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a PUT request asynchronously to the specified URI.

Arity 1: (put-async uri)
Arity 2: (put-async uri request-map)

The request-map is merged with method :put and the given uri.
Use the second arity to add body, headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

queryclj

(query uri)
(query uri request-map)

Sends a QUERY request to the specified URI.

Arity 1: (query uri) Arity 2: (query uri request-map)

The request-map is merged with method :query and the given uri. Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a QUERY request to the specified URI.

Arity 1: (query uri)
Arity 2: (query uri request-map)

The request-map is merged with method :query and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

query-asyncclj

(query-async uri)
(query-async uri request-map)

Sends a QUERY request asynchronously to the specified URI.

Arity 1: (query-async uri) Arity 2: (query-async uri request-map)

The request-map is merged with method :query and the given uri. Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a QUERY request asynchronously to the specified URI.

Arity 1: (query-async uri)
Arity 2: (query-async uri request-map)

The request-map is merged with method :query and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

requestclj

(request request)

Sends an HTTP request using the default client.

Takes a request map with the same keys as java-http.request/build. The request map can also include: :body-handler - Keyword: :string (default), :bytes, :input-stream, :discarding, :file Or an HttpResponse$BodyHandler instance, or a function. :body-handler-file - Path, File, or String (required when :body-handler is :file)

This is the underlying function used by all the HTTP convenience functions.

See java-http.request/build for request map format. See java-http.client/send for return value format.

Sends an HTTP request using the default client.

Takes a request map with the same keys as java-http.request/build.
The request map can also include:
  :body-handler       - Keyword: :string (default), :bytes, :input-stream, :discarding, :file
                        Or an HttpResponse$BodyHandler instance, or a function.
  :body-handler-file  - Path, File, or String (required when :body-handler is :file)

This is the underlying function used by all the HTTP convenience functions.

See java-http.request/build for request map format.
See java-http.client/send for return value format.
raw docstring

request-asyncclj

(request-async request)

Sends an HTTP request asynchronously using the default client.

Takes a request map with the same keys as request. The request map can also include: :body-handler - Keyword: :string (default), :bytes, :input-stream, :discarding, :file Or an HttpResponse$BodyHandler instance, or a function. :body-handler-file - Path, File, or String (required when :body-handler is :file)

Returns a CompletableFuture that will complete with the response map.

See java-http.request/build for request map format. See java-http.client/send-async for return value.

Sends an HTTP request asynchronously using the default client.

Takes a request map with the same keys as request.
The request map can also include:
  :body-handler       - Keyword: :string (default), :bytes, :input-stream, :discarding, :file
                        Or an HttpResponse$BodyHandler instance, or a function.
  :body-handler-file  - Path, File, or String (required when :body-handler is :file)

Returns a CompletableFuture that will complete with the response map.

See java-http.request/build for request map format.
See java-http.client/send-async for return value.
raw docstring

traceclj

(trace uri)
(trace uri request-map)

Sends a TRACE request to the specified URI.

Arity 1: (trace uri) Arity 2: (trace uri request-map)

The request-map is merged with method :trace and the given uri. Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.

Sends a TRACE request to the specified URI.

Arity 1: (trace uri)
Arity 2: (trace uri request-map)

The request-map is merged with method :trace and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a response map with keys: :body, :headers, :status, :uri, :version, :previous-response, :ssl-session.
raw docstring

trace-asyncclj

(trace-async uri)
(trace-async uri request-map)

Sends a TRACE request asynchronously to the specified URI.

Arity 1: (trace-async uri) Arity 2: (trace-async uri request-map)

The request-map is merged with method :trace and the given uri. Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.

Sends a TRACE request asynchronously to the specified URI.

Arity 1: (trace-async uri)
Arity 2: (trace-async uri request-map)

The request-map is merged with method :trace and the given uri.
Use the second arity to add headers, timeout, etc.

Returns a CompletableFuture that will complete with the response map.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close