Skip to content
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

[3.x] Add custom headers to requests #24

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Conversation

DarronEngelbrecht
Copy link
Contributor

Cherry picked commits from #22 for Pest 3.x

This PR allows adding custom headers to the request through the headers method or PEST_STRESS_TEST_OPTIONS variable. We needed this for authentication.

You can use it like this...

$result = stress('example.com')->headers([
    'Authorization' => 'Bearer '. $this->bearerToken,
])

@DarronEngelbrecht DarronEngelbrecht changed the title feat: Add custom headers to requests feat: Add custom headers to requests V3 Nov 23, 2024
@devajmeireles devajmeireles changed the title feat: Add custom headers to requests V3 [3.x] Add custom headers to requests Nov 23, 2024
@ihorchepurnyi
Copy link

Thanks a lot for this PR! It will be a great update for k6.

@ihorchepurnyi
Copy link

Hey @DarronEngelbrecht!

Could you please clarify if you expect to merge this PR this week?

@DarronEngelbrecht
Copy link
Contributor Author

@ihorchepurnyi - Unfortunately unable to merge this myself perhaps @devajmeireles can advise?

Likely waiting on @nunomaduro to merge?

@ihorchepurnyi
Copy link

Hey guys, any updates on this PR?

@nunomaduro nunomaduro merged commit 5e2eb4c into pestphp:3.x Dec 16, 2024
16 of 18 checks passed
@nunomaduro
Copy link
Member

@DarronEngelbrecht can you PR to the docs this update?

@DarronEngelbrecht
Copy link
Contributor Author

@nunomaduro - Done, pestphp/docs#301

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

Successfully merging this pull request may close these issues.

4 participants