From f0e12f9877eeca3bc67f2d56c54c8ca92edd84b3 Mon Sep 17 00:00:00 2001 From: glight2000 <173959153@qq.com> Date: Sat, 12 Dec 2015 20:40:09 +0800 Subject: [PATCH] Update 15.3.md --- eBook/15.3.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eBook/15.3.md b/eBook/15.3.md index cbe418b..0046b8a 100644 --- a/eBook/15.3.md +++ b/eBook/15.3.md @@ -122,13 +122,21 @@ status: Robot cars invade California, on orders from Google: Google has been tes * 另`http.Request`对象的一个重要属性`req`:`req.Method`,这是一个包含`GET`或`POST`字符串,用来描述网页是以何种方式被请求的。 go为所有的HTTP状态码定义了常量,比如: + http.StatusContinue = 100 + http.StatusOK = 200 + http.StatusFound = 302 + http.StatusBadRequest = 400 + http.StatusUnauthorized = 401 + http.StatusForbidden = 403 + http.StatusNotFound = 404 + http.StatusInternalServerError = 500 你可以使用`w.header().Set("Content-Type", "../..")设置头信息