zoukankan      html  css  js  c++  java
  • api接口简短实力

    无参数传递

    public function actionJiekou(){
    $url = 'http://wap.guoshihui.com/_static/wap/video/startVideo.mp4';
    $data = array(
    'status' => '200',
    'message' => '数据获取成功',
    'url' => $url,
    );
    return json_encode($data);
    }

    http://yii.com/frontend/web/index.php?r=country/jiekou

    {"status":"200","message":"u6570u636eu83b7u53d6u6210u529f","url":"http://wap.guoshihui.com/_static/wap/video/startVideo.mp4"}

     有参数传递

    public function actionJiekou(){
    $id = $_GET['id'];
    $url = 'http://wap.guoshihui.com/_static/wap/video/startVideo.mp4';
    $data = array(
    'id' => $id,
    'status' => '200',
    'message' => '数据获取成功',
    'url' => $url,
    );
    return json_encode($data);
    }

    http://yii.com/frontend/web/index.php?r=country/jiekou&id=88897

    {"id":"88897","status":"200","message":"u6570u636eu83b7u53d6u6210u529f","url":"http://wap.guoshihui.com/_static/wap/video/startVideo.mp4"}

  • 相关阅读:
    Java中数组遍历
    数组常见异常
    数组的访问
    Java中数组的定义方式
    Java中数组的概念与特点
    node爬虫技术初探
    node相关内容
    vs code快捷键
    vue 入门开发
    es6 常见用法
  • 原文地址:https://www.cnblogs.com/yszr/p/7893001.html
Copyright © 2011-2022 走看看