Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Lib/InnerBrowser] Send raw content in post body

オープン
#61 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php
領域
api

調査の方向性

src/Codeception/Lib/InnerBrowser.php の189行目付近から始め、sendAjaxPostRequest が2番目のパラメーターをどのように検証およびフォーマットしているかを確認します。ドキュメントに記載された配列の挙動と、raw JSON およびプレーンテキストの例を比較します。呼び出し側が、http_build_query によって変換されることなくrawなコンテンツを送信できれば完了です。

索引モデルが 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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Codeception/lib-innerbrowser のほかの issue

Codeception/lib-innerbrowser の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。