# 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']); } ```