Fork me on GitHub
#clj-http
<
2021-09-04
>
zendevil16:09:25

i make the following curl request and it works, but when I convert it to clj-http, it gives an error. curl

curl -X 'GET' \
  '' \
  -H 'accept: application/json' \
  -H 'X-API-Key: myapikey'
clj-http
(client/get (str ""
                      (-> req :params :contract-address)                   
                      "/owners?chain=eth&format=decimal"
                 {:headers {:accept "application/json"
                            :X-API-Key "myapikey"}}))
clj-http returns 401 with the following body:
"{\"message\":\"API KEY missing from x-api-key header\"}"
How to fix this?

dharrigan16:09:50

Try putting the header like this {"X-API-Key" "myapikey"}