Liking cljdoc? Tell your friends :D

telegrambot-lib.http

Formats and sends the HTTP request to the Telegram Bot API.

Formats and sends the HTTP request to the Telegram Bot API.
raw docstring

clientcljmultimethod

Send HTTP requests to the URL. Methods supported:

  • POST
Send HTTP requests to the URL. Methods supported:
- POST
sourceraw docstring

ex->parsed-respclj

(ex->parsed-resp ex)

Uniformly transform an Exception into a map to return.

Uniformly transform an `Exception` into a map to return.
sourceraw docstring

format-contentcljmultimethod

Format the passed in content map as specified in the :content-type's value or use a default format of json.

Format the passed in content map as specified in the :content-type's value
or use a default format of json.
sourceraw docstring

gen-urlclj

(gen-url this path)

Generate the url to use for the http call, given the method path.

Generate the url to use for the http call, given the method `path`.
sourceraw docstring

map->multipartclj

(map->multipart m)

Transform a map's key/value pairs into a multipart map, with a list of maps with new keys. Eg: {:multipart [{:name key, :content value}] }

Transform a map's key/value pairs into a multipart map,
with a list of maps with new keys.
Eg: {:multipart [{:name key, :content value}] }
sourceraw docstring

parse-respclj

(parse-resp resp)

Parse the JSON response body into a keywordized map.

Parse the JSON response body into a keywordized map.
sourceraw docstring

requestcljmultimethod

Send the request to the Telegram Bot API path with an optional content, either sync- or asynchronously, depending on the value of the :async key of this (the passed bot instance). A sync version returns an "invocation result", while an async one returns a one-off channel with an "invocation result" which is then closed.

The "invocation result" is either:

  • the response body in case the Telegram Bot API request was successful, or
  • a map composed of the response body and the [:error ex] entry when the request was unsuccessful (in terms of the Telegram Bot API), or
  • just an {:error ex} map in any other exceptional situation when we are unable to retrieve the response body.
Send the request to the Telegram Bot API `path` with an optional `content`,
either sync- or asynchronously, depending on the value of the `:async` key
of `this` (the passed bot instance). A sync version returns an "invocation
result", while an async one returns a one-off channel with an "invocation
result" which is then closed.

The "invocation result" is either:
- the response body in case the Telegram Bot API request was successful, or
- a map composed of the response body and the `[:error ex]` entry when the
  request was unsuccessful (in terms of the Telegram Bot API), or
- just an `{:error ex}` map in any other exceptional situation when we are
  unable to retrieve the response body.
sourceraw docstring

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

× close