Skip to content

Response

Brian Zou edited this page Jun 1, 2018 · 2 revisions

响应Response

  • 简介

Http 响应对象

  • 基础使用

response.json(JSONValue va);///响应一个json 对象
response.json(json_string);///响应json string
response.plain("just text");///纯文本
		///链式访问
response.html("<h1>show profile </h1>")
	.setCookie("name", "value", 10000)
	.setCookie("name1", "value", 10000, "/path")
	.setCookie("name2", "value", 10000)
		.setHeader("X-Custom-Info", "hello world");

更多的使用方法请参考hunt框架下的【source/hunt/http/response.d】文件

Clone this wiki locally