Codeception / Codeception/module-rest

How to send raw data with method sendPost?

Open
#110 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
60
Forks
30
Avg merge
22h 37m
Merged PRs (30d)
1

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.