首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Clojure - Ring流响应

Clojure - Ring流响应
EN

Stack Overflow用户
提问于 2017-03-02 00:34:31
回答 1查看 565关注 0票数 1

我收到一个环流响应,我不知道如何处理。

我向ajax POST传递了一个参数,当它到达compojure路由中的函数时,我得到的是一个环流响应,而不是我传递的原始参数

代码语言:javascript
复制
{: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}

这一切为什么要发生?

主体(我相信我的参数所在的位置)是

代码语言:javascript
复制
<< 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} >>

我该如何处理这个问题才能得到我的参数呢?

我的参数应采用{:id id :pass pass}形式

谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-03-02 21:01:39

在定义应用程序处理程序时,从ring.middleware.params添加(wrap-params)中间件可能会有所帮助。

它应该产生一个可访问的:params字段,您可以在请求处理程序中使用该字段。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42537125

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档