Codeception / Codeception/module-rest

How to send raw data with method sendPost?

未关闭
#110 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
60
派生
30
平均合并
22 小时 37 分钟
30 天内合并 PR
1

描述

I want to send POST request with headers and raw data (**string** not **array**)

Test:
```php
$I->haveHttpHeader('HeaderName', 'HeaderValue');
$I->sendPost(url: '/localhost', params: 'my raw content'); // @param array|string|JsonSerializable $params
```

Result:

```php
var_dump(file_get_contents('php://input')); // string(0) ""
var_dump($_POST); // array(0) {}
```

How can this be done?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。