In gRPC, Headers and metadata are the same thing.   The formatting for 
headers should follow normal HTTP rules, such as ignoring case for the 
header key, and only using the right ascii letters in the value.  You can 
find the rules 
here: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md     



On Monday, September 10, 2018 at 9:40:53 AM UTC-7, [email protected] wrote:
>
>
> 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 [email protected].
To post to this group, send email to [email protected].
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/0bbbfb60-8648-4cc1-ab5e-8bb52bd17ea0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to