1- # Requests API
1+ # Data API
22
33This API should be used to receive arbitrary data from the client.
44
5- The API is available in the ` WebView::$requests ` property.
5+ The API is available in the ` WebView::$data ` property.
66
77``` php
88$app = new Boson\Application();
99
10- $app->webview->requests ; // Access to Requests API
10+ $app->webview->data ; // Access to Data API
1111```
1212
1313
@@ -21,7 +21,7 @@ $app = new Boson\Application();
2121
2222$app->on(function (WebViewDomReady $e) use ($app): void {
2323
24- var_dump($app->webview->requests ->get('document.location'));
24+ var_dump($app->webview->data ->get('document.location'));
2525
2626 // array:10 [
2727 // "ancestorOrigins" => []
@@ -48,9 +48,9 @@ is not yet available.
4848<code-block lang =" php " >
4949$app = new Boson\Application();
5050
51- var_dump($app->webview->requests ->get('document.location'));
51+ var_dump($app->webview->data ->get('document.location'));
5252//
53- // Boson\WebView\Requests \Exception\UnprocessableRequestException:
53+ // Boson\WebView\Api\DataApi \Exception\UnprocessableRequestException:
5454// Request "document.location" could not be processed
5555// because application is not running
5656//
@@ -62,15 +62,15 @@ WebView also provides a more convenient way (facade method <code>get()</code>)
6262to get arbitrary data from document.
6363
6464Just use <code >WebView::get()</code > instead of get method
65- from <code >WebView::$requests </code >.
65+ from <code >WebView::$data </code >.
6666
6767<p >  ; </p >
6868
6969<compare >
7070<code-block lang =" php " >
7171$js = 'document.location';
7272
73- $webview->requests ->get($js);
73+ $webview->data ->get($js);
7474</code-block >
7575<code-block lang =" php " >
7676$js = 'document.location';
@@ -97,7 +97,7 @@ Such calls are less convenient, since they use
9797``` php
9898$app = new Boson\Application();
9999
100- $app->webview->requests->send ('document.location')
100+ $app->webview->data->defer ('document.location')
101101 ->then(function ($data) {
102102 var_dump($data);
103103
0 commit comments