Hi, I have this effect:
:http-xhrio {:method :get
:uri "<http://localhost:8080/parse>"
:format (ajax/json-request-format)
:body (.stringify js/JSON (:cell-data db))
:timeout 8000 ;; optional see API docs
:response-format (ajax/json-response-format {:keywords? true}) ;; IMPORTANT!: You must provide this.
:on-success [::good-http-result (assoc cell :data-value value)]
:on-failure [::bad-http-result (assoc cell :data-value value)]}
But at the backend, this is what I see for body:
:body #object[org.eclipse.jetty.server.HttpInput 0x2ff0bd56 "org.eclipse.jetty.server.HttpInput@2ff0bd56"]
Any idea about this?
What you get in your :body
depends on entirely on how you've built your backend.
Given the documentation for HttpInput
, seems like it's a regular input stream - just read it and you should get the body's contents.
So I have added wrap-json-body
at the backend. But doesn't look like the body is getting picked for some reason
I still have no idea what exactly you're doing on your backend. But I can certainly state that it's not related to re-frame in any way. Given the :body #object[...]
above, the content is there - you just have to read it from the stream.