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!

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/9569225f-dadb-44c1-9686-6a3891534a54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to