This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-27
Channels
- # arachne (1)
- # beginners (31)
- # boot (84)
- # cider (9)
- # clara (2)
- # cljs-dev (102)
- # cljsrn (20)
- # clojure (254)
- # clojure-belgium (1)
- # clojure-dusseldorf (17)
- # clojure-greece (7)
- # clojure-italy (6)
- # clojure-russia (2)
- # clojure-spec (8)
- # clojure-uk (9)
- # clojurescript (93)
- # component (4)
- # copenhagen-clojurians (1)
- # cursive (24)
- # datomic (22)
- # editors (1)
- # emacs (8)
- # garden (2)
- # hoplon (357)
- # lein-figwheel (1)
- # leiningen (4)
- # luminus (27)
- # mount (13)
- # off-topic (7)
- # om (71)
- # onyx (35)
- # planck (3)
- # re-frame (53)
- # reagent (35)
- # ring-swagger (24)
- # specter (10)
- # sql (6)
- # untangled (47)
- # vim (157)
Is there a way with this library to view the request that is being made?
I am making a request successfully in postman
but the same request with this library isn’t working
@seancorfield any ideas? ^^^
must be some difference between how postman works and how the clj-http works
@mtkp yep found that
still having issues
request from postman is working
request from clj-http isn't
requests look the same
{:requestLine
#<BasicRequestLine GET https://my307174.crm.ondemand.com/sap/c4c/odata/v1/c4codata/ HTTP/1.1>,
:protocolVersion #<HttpVersion HTTP/1.1>,
:params
#<BasicHttpParams org.apache.http.params.BasicHttpParams@69dfb46d>,
:method "GET",
:config nil,
:class org.apache.http.client.methods.HttpGet,
:allHeaders
[#<BasicHeader Connection: close>,
#<BasicHeader Content-Type: application/json>,
#<BasicHeader x-csrf-token: fetch>,
#<BasicHeader Authorization: Basic <auth>>,
#<BasicHeader accept-encoding: gzip, deflate>],
:aborted false,
:URI
#<URI https://my307174.crm.ondemand.com/sap/c4c/odata/v1/c4codata/>}
GET /sap/c4c/odata/v1/c4codata/ HTTP/1.1
Host:
Authorization: Basic <auth>
x-csrf-token: fetch
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: cdfe98fa-9145-011c-35f1-231586fa4892
first is clj, second is postman
it is success, but then when I use the token to make a write request I get a 403
no the GET is getting the wrong token
it gets a token, but that token doesn’t work
even with a postman POST request
I added that also 😕
(http/request
{:method :get
:url " "
:headers {"Authorization" (str "Basic " (base64/encode “<user>:<pass>"))
"x-csrf-token" "fetch"
"Content-Type" "application/json"
"Cache-Control" "no-cache"}
:debug true
})
hello I'm having a hard time establishing a websocket connection in clojurescript (please let me know if I should post this in the clojurescript channel, though I think it's a trivial mistake) here's the code:
(defonce ws-chan (atom nil))
(defn connect! []
(let [ws (js/WebSocket. ws-url)]
(do
(reset! ws-chan ws)
(loop []
(when (= (.-readyState @ws-chan) 1)
(.log js/console (str "readystate " (.-readyState @ws-chan)))
(recur))))))