php基于curl扩展制作跨平台的restfule 接口

(编辑:jimmy 日期: 2024/9/30 浏览:2)

restfule 接口
适用的平台:跨平台
所依赖:curl扩展
git:https://git.oschina.net/anziguoer/restAPI

ApiServer.php

<"htmlcode">
<"htmlcode">
<"htmlcode">
<"get";
    //逻辑代码根据自己实际项目需要实现
  }  
 
  /**
   * 新增资源操作
   * @return [type] [description]
   */
  protected function _post(){
    echo "post";
    //逻辑代码根据自己实际项目需要实现
  }
 
  /**
   * 删除资源操作
   * @return [type] [description]
   */
  protected function _delete(){
    //逻辑代码根据自己实际项目需要实现
  }
 
  /**
   * 更新资源操作
   * @return [type] [description]
   */
  protected function _put(){
    echo "put";
    //逻辑代码根据自己实际项目需要实现
  }
}
 
$server = new testServer();

以上所述就是本文的全部内容了,希望大家能够喜欢。