Home > Backend Development > PHP Tutorial > 求大神帮忙,CI访问restful有关问题

求大神帮忙,CI访问restful有关问题

WBOY
Release: 2016-06-13 11:50:53
Original
893 people have browsed it

求大神帮忙,CI访问restful问题
CI访问restful服务,服务是C#写的,返回的数据格式为json
接口:MemberService。方法login(int a,string b,string c)
我在网上找了些资料,参考上面写了结果报错。
我的代码如下:

<br /><br />$this->load->library('rest',array('server'=>'http://localhost/TeamLoggingWebHost/MemberService.svc/','http_auto'=>'basic'));<br />$param=array('a'=>1,'b=>'hh','c'=>'kk');<br />$result=$this->rest->Get('login',$param,'application/json');<br /><br />
Copy after login


调试后报错
Unable to load the requsted class: rest

这是不是要引用rest的类库。CI框架里面带有rest的类库吗?

------解决方案--------------------
你的application/libraries或者system/libraries下没定义rest这个类吧

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template