Codeception / Codeception/module-rest

How to send raw data with method sendPost?

Aperta
#110 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
60
Fork
30
Merge medio
22h 37m
PR unite (30g)
1

Descrizione

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?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.