ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
# REST 服务提供商代码MathService ```php /** * Http Add */ public function http_add() { $one = $this->http_input->get('one'); $two = $this->http_input->get('two'); $this->http_output->end($one+$two); } ``` 服务调用放代码 ```php public function http_testREST() { $rest = ConsulServices::getInstance()->getRESTService('MathService', $this->context); $rest->setQuery(['one' => 1, 'two' => 2]); $reuslt = yield $rest->add(); $this->http_output->end($reuslt['body']); } ```