This commit is contained in:
parent
92a8ecffd6
commit
00d71d43ed
1 changed files with 4 additions and 4 deletions
|
@ -5,18 +5,18 @@
|
||||||
(import app.httpsig [auth])
|
(import app.httpsig [auth])
|
||||||
|
|
||||||
|
|
||||||
(defn/a fetch
|
(defn :async fetch
|
||||||
[url]
|
[url]
|
||||||
(.info logger url)
|
(.info logger url)
|
||||||
(return (.json
|
(return (.json
|
||||||
(with/a [client (.AsyncClient httpx)]
|
(with [:async client (.AsyncClient httpx)]
|
||||||
(let [headers {"User-Agent" config.USER_AGENT
|
(let [headers {"User-Agent" config.USER_AGENT
|
||||||
"Accept" config.AP_CONTENT_TYPE}]
|
"Accept" config.AP_CONTENT_TYPE}]
|
||||||
(await (.get client url :headers headers :timeout 15)))))))
|
(await (.get client url :headers headers :timeout 15)))))))
|
||||||
|
|
||||||
(defn/a post
|
(defn :async post
|
||||||
[url payload]
|
[url payload]
|
||||||
(with/a [client (.AsyncClient httpx)]
|
(with [:async client (.AsyncClient httpx)]
|
||||||
(let [headers {"User-Agent" config.USER_AGENT
|
(let [headers {"User-Agent" config.USER_AGENT
|
||||||
"Content-Type" config.AP_CONTENT_TYPE}]
|
"Content-Type" config.AP_CONTENT_TYPE}]
|
||||||
(setv resp
|
(setv resp
|
||||||
|
|
Loading…
Reference in a new issue