(async-request req)
(async-request req opts)
(async-request req opts callback)
(async-request req {:keys [as client raw?]} callback ex-handler)
(delete url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(fn->java-function f)
Turns a Clojure fn form into a Java function
Turns a Clojure fn form into a Java function
(get url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(head url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(options url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(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
(patch url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(post url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(put url & [req opts])
Like #'request, but sets the :method and :url as appropriate.
Like #'request, but sets the :method and :url as appropriate.
(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.
(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:
: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
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.htmlSends 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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close