Es gibt zwei Arten von Transport, die beim Senden von Anfragen an die API verwendet werden können. Unsere Clientbibliothek wählt die optimale Option aus den folgenden aus:
Alternative, die verwendet wird, wenn gRPC nicht verfügbar ist: REST. Es erfordert keine Installation einer PHP-Erweiterung und basiert auf HTTP/1.1.
Wenn Sie den Transporttyp lieber selbst angeben möchten, anstatt sich auf die oben beschriebenen Standardregeln zu verlassen, können Sie die transport-Eigenschaft im Abschnitt CONNECTION der Datei google_ads_php.ini festlegen:
[CONNECTION]; Optional transport settings.; By default, "grpc" is used if available otherwise "rest".transport = "grpc"
Alternativ können Sie die Transporteinstellung wie alle anderen auch programmatisch konfigurieren:
$googleAdsClient = (new GoogleAdsClientBuilder()) ... ->withTransport('grpc') ->build();
[null,null,["Zuletzt aktualisiert: 2025-03-04 (UTC)."],[[["The Google Ads API client library supports two transport types: gRPC (preferred) and REST (fallback)."],["gRPC offers better performance but requires the gRPC PHP extension, while REST is based on HTTP/1.1 and doesn't require any specific extension."],["You can manually specify your preferred transport type through the `google_ads_php.ini` configuration file or programmatically within your code."],["The gRPC version utilized by the library is usually managed through dependencies, primarily `google/gax`, and occasionally directly within the library's own `composer.json` for optimization or compatibility."]]],[]]