Liking cljdoc? Tell your friends :D

java-http-clj.core


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 & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

delete-asyncclj

(delete-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
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 & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

get-asyncclj

(get-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
sourceraw docstring

(head url & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

head-asyncclj

(head-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
sourceraw docstring

optionsclj

(options url & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

options-asyncclj

(options-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
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

patchclj

(patch url & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

patch-asyncclj

(patch-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
sourceraw docstring

postclj

(post url & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

post-asyncclj

(post-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
sourceraw docstring

putclj

(put url & [req opts])

Like #'request, but sets the :method and :url as appropriate.

Like #'request, but sets the :method and :url as appropriate.
sourceraw docstring

put-asyncclj

(put-async url & [req opts callback exception-handler])

Like #'async-request, but sets the :method and :url as appropriate.

Like #'async-request, but sets the :method and :url as appropriate.
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