googleapis / googleapis/google-api-php-client

Add the usage of "global HTTP batch endpoints" to the Developer Documentation?

Open
#2,106 3 comments 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
PHP
Stars
9.8k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

I'd like to send a PR if I am allowed to add the usage of "global HTTP batch endpoints" to the Developer Documentation.

- [Google Developers Blog: Discontinuing support for JSON\-RPC and global HTTP batch endpoints](https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html)

- [Developer Documentation](https://github.com/googleapis/google-api-php-client/tree/master/docs)

On the other hand, I was concerned that not all APIs allow Batch Request, and that it is not a primary way of use.
Is it necessary? Please give me your opinion.

Example:
```php
$client = new Client();
$scopes = [
PagespeedInsights::OPENID,
];
$client->setScopes($scopes);

$url = 'https://foo.bar.dummy.xxx.com';
$client->setDefer(true);
$client->setDeveloperKey('your-key-dummy');

$batch = new Batch($psDeferClient, false, null, 'batch/pagespeedonline/v1');

/** @var \GuzzleHttp\Psr7\Request $request */
$request = $pageSpeedDefer->pagespeedapi->runpagespeed($url);
$batch->add($request, 'foo');

$responses = $batch->execute();
foreach ($responses as $response) {
/** @var PagespeedApiPagespeedResponseV5 $response */
var_dump($response->getId());
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.