Planck HTTP functionality.
Vars
get
head
delete
post
put
patch
([url] [url opts])
Performs a GET request. It takes an URL and an optional map of options. These include::timeout
, number, default 5 seconds:debug
, boolean, assoc the request on to the response:insecure
, proceed even if the connection is considered insecure:accept
, keyword or string. Valid keywords are :json
or :xml
:content-type
, keyword or string Valid keywords are :json
or :xml
:headers
, map, a map containing headers:user-agent
, string, the user agent header to send:follow-redirects
, boolean, follow HTTP location redirects :max-redirects
, number, maximum number of redirects to follow :socket
, string, specifying a system path to a socket to use:binary-response
, boolean, encode response body as vector of unsigned bytesSpec
args: (cat :url string? :opts (? (keys :opt-un [::timeout ::debug ::accept ::content-type ::headers ::socket ::binary-response ::insecure ::user-agent ::follow-redirects ::max-redirects])))
ret: (keys :req-un [::body ::headers ::status])
([url] [url opts])
Performs a HEAD request. It takes an URL and an optional map of options. These include::timeout
, number, default 5 seconds:debug
, boolean, assoc the request on to the response:insecure
, proceed even if the connection is considered insecure:headers
, map, a map containing headers:user-agent
, string, the user agent header to send:socket
, string, specifying a system path to a socket to useSpec
args: (cat :url string? :opts (? (keys :opt-un [::timeout ::debug ::headers ::socket ::insecure ::user-agent])))
ret: (keys :req-un [::body ::headers ::status])
([url] [url opts])
Performs a DELETE request. It takes an URL and an optional map of options. These include::timeout
, number, default 5 seconds:debug
, boolean, assoc the request on to the response:headers
, map, a map containing headers:user-agent
, string, the user agent header to send:socket
, string, specifying a system path to a socket to useSpec
args: (cat :url string? :opts (? (keys :opt-un [::timeout ::debug ::headers ::socket ::insecure ::user-agent])))
ret: (keys :req-un [::body ::headers ::status])
([url] [url opts])
:form-params
, a map, will become the body of the request, urlencoded:multipart-params
, a list of tuples, used for file-upload{:multipart-params [["name" "value"]
["name" ["content" "filename"]]
Spec
args: (cat :url string? :opts (? (keys :opt-un [::timeout ::debug ::accept ::content-type ::headers ::body ::form-params ::multipart-params ::socket ::user-agent])))
ret: (keys :req-un [::body ::headers ::status ::insecure])
([url] [url opts])
:form-params
, a map, will become the body of the request, urlencoded:multipart-params
, a list of tuples, used for file-upload{:multipart-params [["name" "value"]
["name" ["content" "filename"]]
Spec
args: (cat :url string? :opts (? (keys :opt-un [::timeout ::debug ::accept ::content-type ::headers ::body ::form-params ::multipart-params ::socket ::user-agent])))
ret: (keys :req-un [::body ::headers ::status ::insecure])
([url] [url opts])
:form-params
, a map, will become the body of the request, urlencoded:multipart-params
, a list of tuples, used for file-upload{:multipart-params [["name" "value"]
["name" ["content" "filename"]]
Spec
args: (cat :url string? :opts (? (keys :opt-un [::timeout ::debug ::accept ::content-type ::headers ::body ::form-params ::multipart-params ::socket ::insecure ::user-agent])))
ret: (keys :req-un [::body ::headers ::status])