[Lib/InnerBrowser] Send raw content in post body
还没有人认领这个 Issue。
评估
调研方向
从 src/Codeception/Lib/InnerBrowser.php 第 189 行附近开始,检查 sendAjaxPostRequest 如何验证和格式化其第二个参数。将文档中说明的数组行为与原始 JSON 和纯文本示例进行比较;当调用方可以发送原始内容,而不会被 http_build_query 转换时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
What are you trying to achieve?
I am trying to call sendAjaxPostRequest and I would like to pass raw, unformatted parameters to the server.
For example
$I->sendAjaxPostRequest('/some-endpoint', '{"foo": "bar"}');
// or even
$I->sendAjaxPostRequest('/some-endpoint', 'hello, how do you do?')
What do you get instead?
I get an error saying that the second parameter of sendAjaxPostRequest must be of type array. This array then gets converted using http_build_query and there is no way to pass raw data. See https://github.com/Codeception/Codeception/blob/3.1/src/Codeception/Lib/InnerBrowser.php#L189
When passing an array, the array always gets converted to http query params format of foo=bar&example=codeception
I think an alternative approach could be to use REST Module, which I think can accept raw content (or at least properly json_encode body).
Is there something I am missing? How would you suggest to test this endpoint?
- 主要语言
- PHP
- 星标
- 87
- 派生
- 20
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Codeception/lib-innerbrowser 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 42/100
-
难度 2/5 1-3 小时 新手友好度 35/100
Codeception/lib-innerbrowser#31 · 2 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
Codeception/lib-innerbrowser#16 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
查看 Codeception/lib-innerbrowser 的全部 Issue
相似的 Issue
-
sync-en
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
1.severity: security
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Automattic/static-site-importer#1879 ·
维护者通常 1 天内回复
-
bug Installation / Upgrade
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复