Liking cljdoc? Tell your friends :D

java-http-clj.core


async-deleteclj

(async-delete url callback)
(async-delete url req-map callback)
(async-delete url req-map opts callback)

Sends an asynchronous DELETE request to uri.

Sends an asynchronous DELETE request to `uri`.
sourceraw docstring

async-getclj

(async-get url callback)
(async-get url req-map callback)
(async-get url req-map opts callback)

Sends an asynchronous GET request to uri.

Sends an asynchronous GET request to `uri`.
sourceraw docstring

async-headclj

(async-head url callback)
(async-head url req-map callback)
(async-head url req-map opts callback)

Sends an asynchronous HEAD request to uri.

Sends an asynchronous HEAD request to `uri`.
sourceraw docstring

async-postclj

(async-post url callback)
(async-post url req-map callback)
(async-post url req-map opts callback)

Sends an asynchronous POST request to uri.

Sends an asynchronous POST request to `uri`.
sourceraw docstring

async-putclj

(async-put url callback)
(async-put url req-map callback)
(async-put url req-map opts callback)

Sends an asynchronous PUT request to uri.

Sends an asynchronous PUT request to `uri`.
sourceraw docstring

async-requestclj

(async-request req)
(async-request req opts)
(async-request req opts callback)
(async-request req {:keys [as client raw?]} callback ex-handler)
source

build-requestclj

(build-request)
(build-request req-map)
source

build-uriclj

(build-uri uri query-parameters)
source

deleteclj

(delete url)
(delete url req-map)
(delete url req-map opts)

Sends a synchronous DELETE request to uri. See [[send]] for a description of req-map and opts.

Sends a synchronous DELETE request to `uri`.
See [[send]] for a description of `req-map` and `opts`.
sourceraw docstring

fn->java-functioncljmacro

(fn->java-function f)

Turns a Clojure fn form into a Java function

Turns a Clojure fn form into a Java function
sourceraw docstring

getclj

(get url)
(get url req-map)
(get url req-map opts)

Sends a synchronous GET request to uri. See [[send]] for a description of req-map and opts.

Sends a synchronous GET request to `uri`.
See [[send]] for a description of `req-map` and `opts`.
sourceraw docstring

(head url)
(head url req-map)
(head url req-map opts)

Sends a synchronous HEAD request to uri. See [[send]] for a description of req-map and opts.

Sends a synchronous HEAD request to `uri`.
See [[send]] for a description of `req-map` and `opts`.
sourceraw docstring

params->query-stringclj

(params->query-string m)

Converts a map of query parameter options into a URL encoded query string that can be added to a URI

Converts a map of query parameter options into a URL encoded query string that
can be added to a URI
sourceraw docstring

postclj

(post url)
(post url req-map)
(post url req-map opts)

Sends a synchronous POST request to uri. See [[send]] for a description of req-map and opts.

Sends a synchronous POST request to `uri`.
See [[send]] for a description of `req-map` and `opts`.
sourceraw docstring

putclj

(put url)
(put url req-map)
(put url req-map opts)

Sends a synchronous PUT request to uri. See [[send]] for a description of req-map and opts.

Sends a synchronous PUT request to `uri`.
See [[send]] for a description of `req-map` and `opts`.
sourceraw docstring

requestclj

(request req)
(request req {:keys [as client raw?] :as opts})

Sends a HTTP request and blocks until a response is returned or the request takes longer than the specified timeout. If the request times out, a [HttpTimeoutException] (https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpTimeoutException.html) is thrown.

The request map takes the following keys:

  • :method - HTTP method as a keyword (e.g :get, :put, :post)
  • :url - the request url
  • :headers - HTTP headers as a map where keys are strings and values are strings or a list of strings
  • :body - the request body. Can be a string, a primitive Java byte array or a java.io.InputStream.
  • :timeout - the request timeout in milliseconds or a java.time.Duration
  • :version - the HTTP protocol version, one of :http1.1 or :http2

The opts param is a map containing one of the following keys:

Sends a HTTP request and blocks until a response is returned or the request
takes longer than the specified `timeout`.
If the request times out, a [HttpTimeoutException]
(https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpTimeoutException.html) is thrown.

The request map takes the following keys:
- `:method`  - HTTP method as a keyword (e.g `:get`, `:put`, `:post`)
- `:url`     - the request url
- `:headers` - HTTP headers as a map where keys are strings and values are strings or a list of strings
- `:body`    - the request body. Can be a string, a primitive Java byte array or a java.io.InputStream.
- `:timeout` - the request timeout in milliseconds or a `java.time.Duration`
- `:version` - the HTTP protocol version, one of `:http1.1` or `:http2`

The `opts` param is a map containing one of the following keys:
- `:as` - converts the response body to one of the following formats:
  - `:string`       - a java.lang.String (default)
  - `:byte-array`   - a Java primitive byte array.
  - `:input-stream` - a java.io.InputStream.
- `:client` - the [HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html)
              to use for the request. If not provided the [[default-client]] will be used.
- `:raw?`   - if true, skip the Ring format conversion and return the
              raw [HttpResponse](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html
sourceraw docstring

request-builderclj

(request-builder opts)
source

response->mapclj

(response->map resp)
source

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

× close