Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Closes issue #55 #155

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Closes issue #55
peter279k committed Oct 27, 2021

Verified

This commit was signed with the committer’s verified signature.
peter279k Chun-Sheng, Li
commit 7c7bdd31c0c0db4998a7eab12029d713922c4bb8
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.