Questions tagged [clj-http]

an idiomatic Clojure HTTP client wrapping the Apache client

34 questions
1
vote
1 answer

Clj-http is throwing error when trying to connect to the elasticsearch?

Exception in thread "main" clojure.lang.ExceptionInfo: clj-http: status 405 {:status 405, :headers {"Allow" "GET,PUT,HEAD,DELETE", "content-type" "application/json; charset=UTF-8", "content-length" "146"}, :body "{\"error\":\ "Incorrect HTTP…
Harsh Jain
  • 135
  • 11
1
vote
0 answers

How to exclude dependencies from leiningen-2.7.1-standalone.jar when creating Leiningen Plugin?

I'm writing a Leiningen Plugin which uses clj-http library and it's version "3.6.1". It turned out also Leiningen itself uses clj-http library as well but it's version is old one which causes me some problems. Are there any ways to override…
Ertuğrul Çetin
  • 5,131
  • 5
  • 37
  • 76
1
vote
1 answer

clj-http: tracking progress of a multi-part file upload

I am doing a multi-part file upload using clj-http. I am wondering if there is a way I can track the progress of a file upload. Perhaps, some function that gets called periodically with how much of the file has been uploaded so far?
SAN
  • 79
  • 6
1
vote
1 answer

How to perform an http request with clj-http including an api key?

I am trying to make an http request to an api that changes a given sentence to the way yoda might say it. Here is my code that currently gets an error containing "Missing Mashape application key.": (ns clojure-noob.core (:gen-class) (:require…
Jason Basanese
  • 690
  • 6
  • 20
1
vote
1 answer

clojure https connect using TLS 1.2 protocol

Trying connect to https server (https://3dsecure.kkb.kz) using TLS 1.2. (defn- http-request-clojure [xml req-type] (let [url-info (url-map req-type) (prepare-response (.toString (:body (client/get (str…
Amigo
  • 109
  • 7
1
vote
2 answers

handle uncaught_exception in clojure

I have a clojure endpoint in my project which basically updates a document in couchdb. (^{PUT true Path "/{id}" Produces ["application/json"] Consumes ["application/json"] ApiOperation {:value "Update" :notes ""} …
Karthick R
  • 599
  • 9
  • 25
0
votes
2 answers

Clojure GET request of ShipStation using clj-http.client

I'm trying to use a GET request using clj-http.client from ShipStation and getting a 401 error, they have lots of examples of different languages of how to do this. Javascript seems easy: var myHeaders = new Headers(); myHeaders.append("Host",…
0
votes
0 answers

Clojure httpkit spotify request

Following my last question, but to keep the code homogeneous I want to use httpkit to make requests instead of clj-http as I did before. I have the following to try and receive my profile from the Spotify API: (defn get-me [token] …
Jack Gee
  • 136
  • 6
0
votes
1 answer

muutanja error in aws server and not in localhost

Hopefully it makes sense to make a question like this here: I have an python3 api which it uses Flask to serve. I also have an clojure app that makes a post request targeting the python3 api. To do so I use clj-http with something like: (client/post…
0
votes
1 answer

What's the best way to parse a map in clojure when using clj.http?

I have a map like so (client/post "http://localhost:5000" {:form-params {:new {:title "some-title" :description "some-description"}}}) In the server, I have the following: (get-in request [:form-params "new"]) Which gives me the…
zengod
  • 1,114
  • 13
  • 26
0
votes
0 answers

Adding `Content-Length` header to POST request using clj-http.lite?

I just shifted from using clj-http to clj-http.lite . The code used for uploading a file with multipart that worked with clj-http does not seem to work with clj-http-lite . With the later I get an error POST requests require a…
Ashwin
  • 12,691
  • 31
  • 118
  • 190
0
votes
1 answer

SunCertPathBuilderException when calling endpoint using client-side certificate from Kubernetes Docker

We are using clj-http with a keystore consisting of a keystore.pfx with a self-signed certificate: (let [url (str url "api/fetch") opts {:keystore "keystore.pfx" :keystore-type "pkcs12" :keystore-pass "****" …
user2609980
  • 10,264
  • 15
  • 74
  • 143
0
votes
1 answer

Clojurescript error with cljs-http GET request for JSON file - badly formed

Beginner Clojurist here. I'm trying to parse a JSON file using Clojurescript and the cljs-http library. I have strange behaviour using the following function: (defn make-remote-call [endpoint] (go (let [response (
alex314159
  • 3,159
  • 2
  • 20
  • 28
0
votes
1 answer

Send gzip requests with clj-http

How do I send a gzipped request using the dakrone/clj-http client? So far I have: (http/post <> {:body (->> <> cheshire.core/generate-string .getBytes …
bm1729
  • 2,315
  • 3
  • 21
  • 30
0
votes
1 answer

Using clj-http.cookies to set cookie in request

I am trying to create a client cookie for clj-http so that I can set a cookie for a request. Currently I have the cookie data in the format [cookie-name cookie-val] I then call to-basic-client-cookie like so: (clj-http.cookies/to-basic-client-cookie…