Can't access whole form parameter list during handler execution
还没有人认领这个 Issue。
评估
调研方向
从 POST "/api/:variable" handler 示例和链接的 Stack Overflow 问题开始,然后追踪 Ring request body 在 handler 执行前在哪里被消费。完成的标准是确定并记录一种受支持的方式,以便在 handler 中访问完整的表单参数或原始 body。
由索引模型根据 Issue 内容生成。
描述
Library Version(s)
[org.clojure/clojure "1.10.1"]
[metosin/compojure-api "1.1.13"]
[ring/ring-core "1.8.0"]
[metosin/muuntaja "0.6.6"]
[metosin/ring-http-response "0.9.1"]
Problem
I want to get all form/body parameters (or body string) in my request. I've tested out many ways and I can't find any way to do it.
I added many details in this SO question: https://stackoverflow.com/questions/61206840/how-do-i-obtain-all-of-plain-post-form-parameters-in-compojure-api-sweet
I've registered an answer there first because I thought it's a problem of not being familiar with ring and compojure-api. But there is not so much people traffic. If you're interested in more details then read the SO question too.
Code (SO version contains longer one):
(POST "/api/:variable" req
(println
(:form-params req) ;; {}
(:body-params req) ;; {}
(:params req) ;; {:variable asd}
(:body req)) ;; #object[org.eclipse.jetty.server.HttpInputOverHTTP 0x32205a75 HttpInputOverHTTP@32205a75[c=0,q=0,[0]=null,s=EOF]]
(ok))
As I understand the (:body req) is already consumed somewhere but I don't know where and I'd like to get the output of it.
I've read how restructuring works in Compojure api method but it only supports known keys.
- 主要语言
- Clojure
- 星标
- 1.1k
- 派生
- 145
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
metosin/compojure-api 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 45/100
metosin/compojure-api#489 ·
-
难度 5/5 一周以上 新手友好度 30/100
metosin/compojure-api#468 ·
-
难度 5/5 一周以上 新手友好度 20/100
metosin/compojure-api#467 ·
-
难度 5/5 一周以上 新手友好度 25/100
metosin/compojure-api#464 ·
-
难度 5/5 一周以上 新手友好度 30/100
metosin/compojure-api#463 · 3 条评论 ·
查看 metosin/compojure-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
.Needs Triage .Run Repro Bot .Team/UXWest Priority:P3 Type:Bug
难度 2/5 1-3 小时 新手友好度 65/100
metabase/metabase#84325 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
NoahTheDuke/splint#56 ·
-
Permissioned transactions fetch each entity once per tx-step, producing huge permission-check queries可能已有人在做 @verveguy 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 84/100
clojure-lsp/clojure-lsp#2502 ·
维护者通常 1 天内回复