控制器中的方法:

public function response1(){
/*响应的常见类型:
* 1.字符串
* 2.视图
* 3.json
* 4.重定向
* */
//响应JSON
/*$data=[
'errCode'=>0,
'errMsg'=>'success',
'data'=>'sean'
];
return response()->json($data);//返回处理后的json数据:{"errCode":0,"errMsg":"success","data":"sean"}
*/ //4.重定向:
//return redirect('response2'); //重定向到response2中 //重定向并携带参数:
//return redirect('response2')->with('message','我是快闪数据'); //action()跳转:
//return redirect()->action('StudentController@response2')->with('message','我是快闪数据'); //route() 通过别名跳转:
//return redirect()->route('response2')->with('message','我是快闪数据'); //返回上一个页面
return redirect()->back();
}
public function response2(){
//return '我是response2';
return Session::get('message','暂无数据'); //只有一次:
}

  

1-3Controller之Response的更多相关文章

  1. Response.Redirect引起的性能问题分析

    现象: 最近做的一个系统通过单点登录(SSO) 技术验证用户登录.用户在SSO 系统上通过验证后,跳转到该系统的不同模块.而跳转的时间一直维持子啊几分钟左右. 分析步骤: 在问题复现时抓取Hang d ...

  2. windows charles response 乱码解决办法

    使用windows 版本的charles来做代理,发现服务端返回的response会出现中文乱码的情况, 查看软件设置,遗憾的是并没有关于编码的选项. 好在charles windows版本安装目录下 ...

  3. 谈一谈Http Request 与 Http Response

    写在前面的话:今天来总结一下http相关的request和response,就从以下几个问题入手吧. ======正文开始======== 1.什么是HTTP Request 与HTTP Respon ...

  4. ashx中Response.ContentType的常用类型

    ashx中Response.ContentType的常用类型: text/plaintext/htmltext/xmlapplication/jsonimage/GIFapplication/x-cd ...

  5. 一个由Response.Redirect 引起的性能问题的分析

    现象: 某系统通过单点登录(SSO) 技术验证用户登录.用户在SSO 系统上通过验证后,跳转到某系统的主页上面.而跳转的时间很长,约1分钟以上. 分析步骤: 在问题复现时抓取Hang dump 进行分 ...

  6. request 对象和 response 对象

    Web服务器收到客户端的http请求,会针对每一次请求,分别创建一个用于代表请求的request对象.和代表响应的response对象 HttpServletResponse HttpServletR ...

  7. C#、JAVA操作Hadoop(HDFS、Map/Reduce)真实过程概述。组件、源码下载。无法解决:Response status code does not indicate success: 500。

    一.Hadoop环境配置概述 三台虚拟机,操作系统为:Ubuntu 16.04. Hadoop版本:2.7.2 NameNode:192.168.72.132 DataNode:192.168.72. ...

  8. response和request的区别以及常见问题解决

    request是请求,即客服端发来的请求 response是响应,是服务器做出的响应 --------------------------------------------------------- ...

  9. Webform(五)——内置对象(Response、Request)和Repeater中的数据增删改

    一.内置对象 (一)Response对象 1.简介:response 对象在ASP中负责将信息传递给用户.Response对象用于动态响应客户端请求,并将动态生成的响应结果返回到客户端浏览器中,使用R ...

  10. Hemodynamic response function (HRF) - FAQ

    Source: MIT - Mindhive What is the 'canonical' HRF? The very simplest design matrix for a given expe ...

随机推荐

  1. python中那些双下划线开头得函数和变量

    Python中下划线---完全解读     Python 用下划线作为变量前缀和后缀指定特殊变量 _xxx 不能用’from module import *’导入 __xxx__ 系统定义名字 __x ...

  2. ABP配置模块扩展

    1.定义一个接口  里面是配置的属性等 public interface IMyConfiguration { int Id { get; set; } string Name { get; set; ...

  3. python静态方法、类方法

    常规: class Dog(object): def __init__(self,name): self.name=name def eat(self): print('%s is eating'%s ...

  4. JS中的弹窗问题confirm和prompt

    JavaScript-确认(confirm 消息对话框) confirm 消息对话框通常用于允许用户做选择的动作,如:“你对吗?”等.弹出对话框(包括一个确定按钮和一个取消按钮). 语法: confi ...

  5. Codeforces 377A - Maze

    A. Maze 题目链接:http://codeforces.com/contest/377/problem/A time limit per test 2 seconds memory limit ...

  6. input = time 微信端(移动端)

    垂直居中不管用:用margin-top解决 默认值value 不生效:严格按照日期格式设置

  7. h5 audio进度条

    h5 audio 播放进度条 效果图: html部分: <div class="audiojindu"> <div class="playcontrol ...

  8. causal snps | causal variants | tensorflow | 神经网络实战 | Data Simulation

    先读几篇文章: Interpretation of Association Signals and Identification of Causal Variants from Genome-wide ...

  9. springboot---->javax.servlet.ServletException

    springboot访问静态资源时发生以下异常: javax.servlet.ServletException: Circular view path [login]: would dispatch ...

  10. JSON和Serialize数据格式的对比

    1.相同点: 都是把其它数据类型转换为可传输的字符串 都是结构性数据 2.不同点: JSON比Serialize序列后的格式要简洁 Serialize序列化的数据格式保存数据原有类型 3.扩展 JSO ...