hprose / hprose-php

Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP
MIT License
1.97k stars 390 forks source link

如何传输headers #131

Closed artemus717 closed 4 years ago

artemus717 commented 4 years ago

是否可以实现透传header头,例如应用收到请求header中带有request_id字段,如何将此头部带入下一个请求中?实现链路追踪。

andot commented 4 years ago

可以,旧的 2.0 版本的 client 可以设置 http 的 header。

新的 3.0 版本除了 http header 可以设置以外,还支持底层传输协议无关的 header 设置,通过 context 的 requestHeader 属性来设置就可以了。

artemus717 commented 4 years ago

我们也看了下这篇,搞定了,感谢! https://github.com/hprose/hprose-php/issues/83