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

Allow passing server parameters on form submit #405

Open
soullivaneuh opened this issue Mar 22, 2018 · 0 comments
Open

Allow passing server parameters on form submit #405

soullivaneuh opened this issue Mar 22, 2018 · 0 comments
Labels

Comments

@soullivaneuh
Copy link
Contributor

When you do something like this:

$form = $crawler->selectButton('Submit')->form();
$crawler = $client->submit($form, [
    'foo' => 'bar',
]);

You can't pass any server value. But it can be useful, for example, to passe XHR header: https://stackoverflow.com/a/9505494/1731473

Current possible workaround:

$crawler = $client->request($form->getMethod(), $form->getUri(), $form->getPhpValues(), $form->getPhpFiles(), [
    'HTTP_X-Requested-With' => 'XMLHttpRequest',
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants