2017-03-01 62 views
1

我得到了一個環流響應,我不知道該如何處理。Clojure - 環流響應

我在一個參數傳遞給我的AJAX POST和當它到達的功能在我的Compojure路線,而不是被我通過在原有的參數,我得到一個環流反應是

{:remote-addr 0:0:0:0:0:0:0:1, :params nil, :route-params nil, :headers {origin http://localhost:3300, host localhost:3300, user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.2883.87 Chrome/55.0.2883.87 Safari/537.36, content-type application/transit+json, content-length 42, referer http://localhost:3300/view, connection keep-alive, accept application/transit+json, application/transit+transit, application/json, text/plain, text/html, */*, accept-language en-GB,en-US;q=0.8,en;q=0.6, accept-encoding gzip, deflate, br}, :server-port 3300, :keep-alive? true, :uri /add-user!, :server-name ip6-localhost, :query-string nil, :body << stream: {:pending-puts 0, :drained? false, :buffer-size 42, :permanent? false, :type netty, :sink? true, :closed? true, :pending-takes 0, :buffer-capacity 16384, :connection {:local-address ip6-localhost/0:0:0:0:0:0:0:1:3300, :remote-address /0:0:0:0:0:0:0:1:34448, :writable? true, :readable? true, :closed? false, :direction :inbound}, :source? true} >>, :scheme :http, :request-method :post} 

爲什麼這是否發生?

體(其中我相信我的謊言PARAM)是

<< stream: {:pending-puts 0, :drained? false, :buffer-size 30, :permanent? false, :type netty, :sink? true, :closed? true, :pending-takes 0, :buffer-capacity 16384, :connection {:local-address ip6-localhost/0:0:0:0:0:0:0:1:3300, :remote-address /0:0:0:0:0:0:0:1:34580, :writable? true, :readable? true, :closed? false, :direction :inbound}, :source? true} >> 

如何處理這個讓我的參數超出?

我的參數應該是形式{:id id :pass pass}

感謝

+1

你用什麼中間件爲你的環形服務器? –

+0

我正在使用compojure,因此我認爲ring中間件。 – rbb

回答

0

定義你的應用程序處理程序可能會幫助時從ring.middleware.params添加(wrap-params)中間件。

它應該會產生一個可訪問的:params字段,您可以在您的請求處理程序中使用該字段。