I am attempting to set some HTTP headers in gRPC client call written in PHP. I cannot find anything specifying how to do this in PHP. From reading docs for other languages I have come to think that headers are specified in the client metadata. However, I can't find anything on how these should be formatted, and all the formats I try don't seem to work. Here is my code:
$options = [
'credentials' => $this->credentialsObject,
'update_metadata' => function($metaData){
$metaData['headers'] = ['Authorization' => 'Bearer ' . $this->token];
return $metaData;
}
];
$client = new OrganizationServiceClient($this->url,$options);
$r = new \Google\Protobuf\GPBEmpty();
list($data,$status) = $client->list($r)->wait();
Any help or pointers would be appreciated. I'm been working on this for a few days now and feel like I've trying everything I can think of.
Thanks!