Skip to content

Commit

Permalink
Closes issue rialto-php#55
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Oct 27, 2021
1 parent a649d0a commit 7c7bdd3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ printf('Dimensions: %s', print_r($dimensions, true));
$browser->close();
```

**Example** - send post request:

```php
$puppeteer = new Puppeteer();
$browser = $puppeteer->launch();
$page = $browser->newPage();

$page->setRequestInterception(true);
$page->on('request', new JsFunction(
['interceptedRequest'],
"
var data = {
'method': 'POST',
'postData': '" . http_build_query($options['form_params']) . "'
};
interceptedRequest.continue(data);
"
));

$response = $page->goto('https://example.com');
```

## Requirements and installation

This package requires PHP >= 7.3 and Node >= 8.
Expand Down

0 comments on commit 7c7bdd3

Please sign in to comment.