Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to send raw data with method sendPost? #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
s1lver opened this issue Jan 20, 2025 · 0 comments
Open

How to send raw data with method sendPost? #110

s1lver opened this issue Jan 20, 2025 · 0 comments

Comments

@s1lver
Copy link
Contributor

s1lver commented Jan 20, 2025

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

Test:

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

Result:

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

How can this be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant