|
@@ -120,7 +120,7 @@ status: Robot cars invade California, on orders from Google: Google has been tes
|
|
|
* `http.NotFound(w ResponseWriter, r *Request)`:这个函数将返回网页没有找到,HTTP 404错误。
|
|
* `http.NotFound(w ResponseWriter, r *Request)`:这个函数将返回网页没有找到,HTTP 404错误。
|
|
|
* `http.Error(w ResponseWriter, error string, code int)`:这个函数返回特定的错误信息和HTTP代码。
|
|
* `http.Error(w ResponseWriter, error string, code int)`:这个函数返回特定的错误信息和HTTP代码。
|
|
|
* 另`http.Request`对象的一个重要属性`req`:`req.Method`,这是一个包含`GET`或`POST`字符串,用来描述网页是以何种方式被请求的。
|
|
* 另`http.Request`对象的一个重要属性`req`:`req.Method`,这是一个包含`GET`或`POST`字符串,用来描述网页是以何种方式被请求的。
|
|
|
-```
|
|
|
|
|
|
|
+
|
|
|
go为所有的HTTP状态码定义了常量,比如:
|
|
go为所有的HTTP状态码定义了常量,比如:
|
|
|
http.StatusContinue = 100
|
|
http.StatusContinue = 100
|
|
|
http.StatusOK = 200
|
|
http.StatusOK = 200
|