Should be used to perform HTTP requests. It allows you to automatically expose metrics about the requests made by your system. Also allows you to easily check the requests made during an integration test.
Under the hood, it uses the clj-http
library to perform the requests.
The metrics exposed by this component are:
The metrics are exposed using Prometheus. And you should add the prometheus component to your system map to expose them and also add the Prometheus component as a dependency for the HTTP Client component.
In this first example we are performing a get request for the Google homepage.
The :endpoint-id
property is used only to label the request in the metrics. It is not mandatory.
(component.http-client/request! {:url "https://google.com.br"
:method :get
:endpoint-id :xp-fetch-google-homepage} http-client)
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |